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.pull/3/head
parent
4e5e0c125f
commit
b52d72f176
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue