- Small corrections to the role definitions (Tenant Tester and Tenant Financial Roles are no longer required)

This commit is contained in:
Josako
2025-04-03 14:23:22 +02:00
parent 9ad7c1aee9
commit 8daa52d1e9
2 changed files with 12 additions and 13 deletions

View File

@@ -18,19 +18,18 @@ depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute("""
INSERT INTO public.role (name, description)
VALUES ('Tenant Financial', 'Role for managing tenant financial operations');
""")
#
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.execute("""
DELETE FROM public.role
WHERE name = 'Tenant Financial';
""")
# op.execute("""
# DELETE FROM public.role
# WHERE name = 'Tenant Financial';
# """)
pass
# ### end Alembic commands ###

View File

@@ -38,11 +38,11 @@ def initialize_data():
tenant_admin_role = Role(name="Tenant Admin", description="Users allowed to manage tenants")
db.session.add(tenant_admin_role)
db.session.commit()
tenant_tester_role = Role.query.filter_by(name="Tenant Tester").first()
if tenant_tester_role is None:
tenant_test_role = Role(name="Tenant Tester", description="Users allowed to test tenants")
db.session.add(tenant_test_role)
db.session.commit()
# tenant_tester_role = Role.query.filter_by(name="Tenant Tester").first()
# if tenant_tester_role is None:
# tenant_test_role = Role(name="Tenant Tester", description="Users allowed to test tenants")
# db.session.add(tenant_test_role)
# db.session.commit()
# Check if any users exist
if User.query.first() is None: