- Small corrections to the role definitions (Tenant Tester and Tenant Financial Roles are no longer required)
This commit is contained in:
@@ -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 ###
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user