mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Do flush the changes done after creating the require tables. Because -
it causes an issue performing DDL operations without sending DML to the database, flush(..) does the job for us, it sends those operations to the database without committing it. And, this was causing the issue in current implemenation, while setting 'Administrator' role to the given email-id after the create_role, and create_user operations during setup.
This commit is contained in:
@@ -54,6 +54,7 @@ def do_setup(app):
|
||||
db.create_all()
|
||||
user_datastore.create_role(name='Administrators', description='pgAdmin Administrators Role')
|
||||
user_datastore.create_user(email=email, password=password)
|
||||
db.session.flush()
|
||||
user_datastore.add_role_to_user(email, 'Administrators')
|
||||
|
||||
# Get the user's ID and create the default server group
|
||||
|
Reference in New Issue
Block a user