Bug Report(py wheel v4.18):'Request' object has no attribute 'is_xhr'

From: Safford <huang_haoting(at)126(dot)com>
To: pgadmin-hackers(at)lists(dot)postgresql(dot)org
Subject: Bug Report(py wheel v4.18):'Request' object has no attribute 'is_xhr'
Date: 2020-02-16 15:37:33
Message-ID: B14EB3D7-01CF-461B-A1CF-5426CE364FDF@126.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

When running pgAdmin4 python wheel version on Ubuntu 18.04 & python 3.6, I met this bug when entering 127.0.0.1:5050 in my browser:
```
2020-02-16 23:21:38,883: ERROR pgadmin: 'Request' object has no attribute 'is_xhr'
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.6/dist-packages/flask_login/utils.py", line 260, in decorated_view
return current_app.login_manager.unauthorized()
File "/usr/local/lib/python3.6/dist-packages/flask_login/login_manager.py", line 152, in unauthorized
return self.unauthorized_callback()
File "/usr/local/lib/python3.6/dist-packages/pgadmin4/pgadmin/utils/session.py", line 355, in pga_unauthorised
if not lm.login_view or request.is_xhr:
File "/usr/local/lib/python3.6/dist-packages/werkzeug/local.py", line 347, in __getattr__
return getattr(self._get_current_object(), name)
AttributeError: 'Request' object has no attribute ‘is_xhr'
```
I don’t know how to solve this problem, so I ask for help there.
My dependencies are:
Flask (1.1.1)
Flask-BabelEx (0.9.4)
Flask-Compress (1.4.0)
Flask-Gravatar (0.5.0)
Flask-Login (0.4.1)
Flask-Mail (0.9.1)
Flask-Migrate (2.4.0)
Flask-Paranoid (0.2.0)
Flask-Principal (0.4.0)
Flask-Security (3.0.0)
Flask-SQLAlchemy (2.3.2)
Flask-WTF (0.14.3)
Werkzeug (1.0.0)
pgAdmin4(4.18)

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Akshay Joshi 2020-02-17 05:13:27 Re: Bug Report(py wheel v4.18):'Request' object has no attribute 'is_xhr'
Previous Message Nagesh Dhope 2020-02-14 08:10:41 [pgAdmin4][RM5185] Option to override select2control's label className