pgadmin4 setup.py, first time run

Поиск
Список
Период
Сортировка
От Prasad
Тема pgadmin4 setup.py, first time run
Дата
Msg-id trinity-dc01e743-5753-487f-b9b0-22525f6ce3de-1441496556982@3capp-mailcom-lxa14
обсуждение исходный текст
Ответы Re: pgadmin4 setup.py, first time run  (Dave Page <dpage@pgadmin.org>)
Список pgadmin-hackers
Hi,

When you try to run pgadmin4 for first time(without presence of pgadmin4.db), it ask you to run setup.py. When you run
it,it throws python error as follows, 
Traceback (most recent call last):
  File "/home/test/Development/pgadmin4/web/setup.py", line 145, in <module>
    do_setup(app)
  File "/home/test/Development/pgadmin4/web/setup.py", line 57, in do_setup
    user_datastore.add_role_to_user(email, 'Administrators')
  File "/usr/local/lib/python2.7/dist-packages/Flask_Security-1.7.4-py2.7.egg/flask_security/datastore.py", line 106,
inadd_role_to_user 
    if role not in user.roles:
AttributeError: 'NoneType' object has no attribute 'roles'

It's because,user_datastore.create_role,user_datastore.create_user and user_datastore.add_role_to_user all calls are
forin one database transaction. It need to commit it after first two calls or creating role and user for
add_role_to_userto work, 

Find attached patch for this.

regards,
Prasad Somwanshi

Вложения

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: PATCH: improve sorting in the Data Editor
Следующее
От: Dave Page
Дата:
Сообщение: Re: pgadmin4 setup.py, first time run