From: | Prasad <prasad(dot)s(at)mail(dot)com> |
---|---|
To: | "Khushboo Vashi" <khushboo(dot)vashi(at)enterprisedb(dot)com> |
Cc: | "Dave Page" <dpage(at)pgadmin(dot)org>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org> |
Subject: | Re: pgadmin4 setup.py, first time run |
Date: | 2015-09-07 11:57:35 |
Message-ID: | trinity-504c3380-a04b-42e0-8cf4-50b886acebb5-1441627054940@3capp-mailcom-lxa10 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers |
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>I'd this issue on Ubuntu x64. And using Python editor IDLE to run setup.py</div>
<div> </div>
<div>regards,</div>
<div>Prasad Somwanshi<br/>
<br/>
<br/>
<br/>
<br/>
Sent: Monday, September 07, 2015 at 12:36 PM<br/>
From: "Khushboo Vashi" <khushboo(dot)vashi(at)enterprisedb(dot)com><br/>
To: "Dave Page" <dpage(at)pgadmin(dot)org><br/>
Cc: Prasad <prasad(dot)s(at)mail(dot)com>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org><br/>
Subject: Re: [pgadmin-hackers] pgadmin4 setup.py, first time run<br/>
<br/>
Hi Dave,<br/>
<br/>
I have tried to reproduce the issue but couldn't reproduce it on UBUNTU as well as on MAC.<br/>
<br/>
I have checked the online examples of SQLAlchemyUserDatastore, and I think<br/>
it is logical that before assigning the new role to the newly created user, user should be committed first.<br/>
Thanks,Khushboo<br/>
<br/>
<br/>
On Mon, Sep 7, 2015 at 1:49 PM, Khushboo Vashi <khushboo(dot)vashi(at)enterprisedb(dot)com> wrote:<br/>
<br/>
Yes. I am looking into this.<br/>
Thanks,Khushboo<br/>
<br/>
<br/>
On Mon, Sep 7, 2015 at 1:31 PM, Dave Page <dpage(at)pgadmin(dot)org[dpage@pgadmin.org]> wrote:Khushboo, can you look at this please?<br/>
<br/>
Thanks.<br/>
<br/>
On Sun, Sep 6, 2015 at 12:42 AM, Prasad <prasad(dot)s(at)mail(dot)com[prasad(dot)s@mail.com]> wrote:<br/>
> Hi,<br/>
><br/>
> 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,<br/>
> Traceback (most recent call last):<br/>
> File "/home/test/Development/pgadmin4/web/setup.py", line 145, in <module><br/>
> do_setup(app)<br/>
> File "/home/test/Development/pgadmin4/web/setup.py", line 57, in do_setup<br/>
> user_datastore.add_role_to_user(email, 'Administrators')<br/>
> File "/usr/local/lib/python2.7/dist-packages/Flask_Security-1.7.4-py2.7.egg/flask_security/datastore.py", line 106, in add_role_to_user<br/>
> if role not in user.roles:<br/>
> AttributeError: 'NoneType' object has no attribute 'roles'<br/>
><br/>
> It's because,user_datastore.create_role,user_datastore.create_user and user_datastore.add_role_to_user all calls are for in one database transaction. It need to commit it after first two calls or creating role and user for add_role_to_user to work,<br/>
><br/>
> Find attached patch for this.<br/>
><br/>
> regards,<br/>
> Prasad Somwanshi<br/>
><br/>
><br/>
> --<br/>
> Sent via pgadmin-hackers mailing list (pgadmin-hackers(at)postgresql(dot)org[pgadmin-hackers@postgresql.org])<br/>
> To make changes to your subscription:<br/>
> <a href="http://www.postgresql.org/mailpref/pgadmin-hackers" target="_blank">http://www.postgresql.org/mailpref/pgadmin-hackers</a>[<a href="http://www.postgresql.org/mailpref/pgadmin-hackers" target="_blank">http://www.postgresql.org/mailpref/pgadmin-hackers</a>]<br/>
><br/>
<br/>
<br/>
<br/>
--<br/>
Dave Page<br/>
Blog: <a href="http://pgsnake.blogspot.com" target="_blank">http://pgsnake.blogspot.com</a>[<a href="http://pgsnake.blogspot.com" target="_blank">http://pgsnake.blogspot.com</a>]<br/>
Twitter: @pgsnake<br/>
<br/>
EnterpriseDB UK: <a href="http://www.enterprisedb.com" target="_blank">http://www.enterprisedb.com</a>[<a href="http://www.enterprisedb.com" target="_blank">http://www.enterprisedb.com</a>]<br/>
The Enterprise PostgreSQL Company</div></div></body></html>
Attachment | Content-Type | Size |
---|---|---|
unknown_filename | text/html | 3.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2015-09-07 11:58:19 | Re: pgadmin4 setup.py, first time run |
Previous Message | Khushboo Vashi | 2015-09-07 11:36:33 | Re: pgadmin4 setup.py, first time run |