Re: pgadmin4 setup.py, first time run

From: Khushboo Vashi <khushboo(dot)vashi(at)enterprisedb(dot)com>
To: Prasad <prasad(dot)s(at)mail(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 12:55:07
Message-ID: CAFOhELdxyiY70DsATk5SXjJfzLSmeCyjPqUEdoqnN=PDcZMz5A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Mon, Sep 7, 2015 at 5:27 PM, Prasad <prasad(dot)s(at)mail(dot)com> wrote:

> I'd this issue on Ubuntu x64. And using Python editor IDLE to run setup.py
>

I have also tried on Ubuntu x64, but couldn't reproduce.

> regards,
> Prasad Somwanshi
>
>
>
>
> Sent: Monday, September 07, 2015 at 12:36 PM
> From: "Khushboo Vashi" <khushboo(dot)vashi(at)enterprisedb(dot)com>
> To: "Dave Page" <dpage(at)pgadmin(dot)org>
> Cc: Prasad <prasad(dot)s(at)mail(dot)com>, pgadmin-hackers <
> pgadmin-hackers(at)postgresql(dot)org>
> Subject: Re: [pgadmin-hackers] pgadmin4 setup.py, first time run
>
> Hi Dave,
>
> I have tried to reproduce the issue but couldn't reproduce it on UBUNTU as
> well as on MAC.
>
> I have checked the online examples of SQLAlchemyUserDatastore, and I think
> it is logical that before assigning the new role to the newly created
> user, user should be committed first.
> Thanks,Khushboo
>
>
> On Mon, Sep 7, 2015 at 1:49 PM, Khushboo Vashi <
> khushboo(dot)vashi(at)enterprisedb(dot)com> wrote:
>
> Yes. I am looking into this.
> Thanks,Khushboo
>
>
> On Mon, Sep 7, 2015 at 1:31 PM, Dave Page <dpage(at)pgadmin(dot)org[
> dpage(at)pgadmin(dot)org]> wrote:Khushboo, can you look at this please?
>
> Thanks.
>
> On Sun, Sep 6, 2015 at 12:42 AM, Prasad <prasad(dot)s(at)mail(dot)com[
> prasad(dot)s(at)mail(dot)com]> wrote:
> > 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, in add_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 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,
> >
> > Find attached patch for this.
> >
> > regards,
> > Prasad Somwanshi
> >
> >
> > --
> > Sent via pgadmin-hackers mailing list (pgadmin-hackers(at)postgresql(dot)org[
> pgadmin-hackers(at)postgresql(dot)org])
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgadmin-hackers[
> http://www.postgresql.org/mailpref/pgadmin-hackers]
> >
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com[http://pgsnake.blogspot.com]
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com[http://www.enterprisedb.com]
> The Enterprise PostgreSQL Company
>

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2015-09-07 12:59:01 Re: pgadmin4 setup.py, first time run
Previous Message Khushboo Vashi 2015-09-07 12:53:33 Re: pgadmin4 setup.py, first time run