davidjurgens / potato

potato: portable text annotation tool
Other
299 stars 51 forks source link

Login stops working if user logs out immediately after the pre-annotation questionnaire #68

Open aleksandra-miletic opened 1 year ago

aleksandra-miletic commented 1 year ago

Hi,

I'm using potato for an annotation project which has a pre-study questionnaire. Multiple users have reported that their login stops working if they log out immediately after completing the questionnaire (and before completing the annotation task on the first annotation page). The next time they try to log in they get an Internal Server Error, and in the logs I find this:

INFO:potato.flask_server:Loaded 0 annotations for known user "XYZ" ERROR:potato.flask_server:Exception on /login [POST] Traceback (most recent call last): File "/home/ubuntu/flaskenv/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app response = self.full_dispatch_request() File "/home/ubuntu/flaskenv/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/ubuntu/flaskenv/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() File "/home/ubuntu/flaskenv/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/home/ubuntu/flaskenv/lib/python3.10/site-packages/potato/flask_server.py", line 1112, in login return annotate_page(username) File "/home/ubuntu/flaskenv/lib/python3.10/site-packages/potato/flask_server.py", line 2120, in annotate_page if (input_field.name != "textarea") and (input_field["value"] != value): File "/home/ubuntu/flaskenv/lib/python3.10/site-packages/bs4/element.py", line 1573, in getitem return self.attrs[key] KeyError: 'value'

Do you have an idea why this is happening and what I can do to solve it? Any help is appreciated!

Thanks, Aleksandra

Jiaxin-Pei commented 1 year ago

Hi @aleksandra-miletic, which version of potato-annotation are you using?

This seems to be an issue fixed with version 1.2.0.30

aleksandra-miletic commented 1 year ago

Hi @Jiaxin-Pei, This does seem to be a version issue, since I'm using 1.2.0.25. I'll update to 1.2.0.30.

Thanks for the quick reply! Best, Aleksandra