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
Ashesh Vashi 2015-09-22 11:16:43 +05:30
parent 4e5e0c125f
commit b52d72f176
1 changed files with 1 additions and 0 deletions

View File

@ -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