Merge pull request 'fix: seed palettes run error' (#2) from furqan into dev
Reviewed-on: https://gitea.maskantech.in/gitea_admin/saas_backend/pulls/2
This commit is contained in:
@@ -132,16 +132,19 @@ def seed_palettes():
|
||||
description=p_data["description"],
|
||||
is_default=p_data["is_default"],
|
||||
colors=p_data["colors"],
|
||||
tenant_id=None
|
||||
)
|
||||
db.add(palette)
|
||||
print(f"Creating palette: {p_data['name']}")
|
||||
else:
|
||||
print(f"Palette already exists: {p_data['name']}")
|
||||
existing.colors = p_data["colors"]
|
||||
existing.is_default = p_data["is_default"]
|
||||
|
||||
db.commit()
|
||||
print("Done seeding palettes.")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error seeding palettes: {e}")
|
||||
db.rollback()
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
Reference in New Issue
Block a user