- 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():
|
def upgrade():
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
op.execute("""
|
#
|
||||||
INSERT INTO public.role (name, description)
|
pass
|
||||||
VALUES ('Tenant Financial', 'Role for managing tenant financial operations');
|
|
||||||
""")
|
|
||||||
|
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
def downgrade():
|
def downgrade():
|
||||||
# ### commands auto generated by Alembic - please adjust! ###
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
op.execute("""
|
# op.execute("""
|
||||||
DELETE FROM public.role
|
# DELETE FROM public.role
|
||||||
WHERE name = 'Tenant Financial';
|
# WHERE name = 'Tenant Financial';
|
||||||
""")
|
# """)
|
||||||
|
pass
|
||||||
|
|
||||||
# ### end Alembic commands ###
|
# ### end Alembic commands ###
|
||||||
|
|||||||
@@ -38,11 +38,11 @@ def initialize_data():
|
|||||||
tenant_admin_role = Role(name="Tenant Admin", description="Users allowed to manage tenants")
|
tenant_admin_role = Role(name="Tenant Admin", description="Users allowed to manage tenants")
|
||||||
db.session.add(tenant_admin_role)
|
db.session.add(tenant_admin_role)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
tenant_tester_role = Role.query.filter_by(name="Tenant Tester").first()
|
# tenant_tester_role = Role.query.filter_by(name="Tenant Tester").first()
|
||||||
if tenant_tester_role is None:
|
# if tenant_tester_role is None:
|
||||||
tenant_test_role = Role(name="Tenant Tester", description="Users allowed to test tenants")
|
# tenant_test_role = Role(name="Tenant Tester", description="Users allowed to test tenants")
|
||||||
db.session.add(tenant_test_role)
|
# db.session.add(tenant_test_role)
|
||||||
db.session.commit()
|
# db.session.commit()
|
||||||
|
|
||||||
# Check if any users exist
|
# Check if any users exist
|
||||||
if User.query.first() is None:
|
if User.query.first() is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user