ecotaxa / ecotaxa_back

Backend of the EcoTaxa application
GNU General Public License v3.0
6 stars 5 forks source link

api/object_set/export: `500 Internal Server Error` instead of `401 Unauthorized` #39

Closed moi90 closed 2 years ago

moi90 commented 2 years ago
Request url: POST https://ecotaxa.obs-vlfr.fr/api/object_set/export
Request headers: {'User-Agent': 'python-requests/2.25.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Authorization': 'Bearer eyJ1c2VyX2lkIjoxNzZ9.YjsALg.qROfIBDH6T5fIaTlkjfWAXqsMfM', 'Content-Length': '304', 'Content-Type': 'application/json'}
Response headers: {'Content-Type': 'text/plain; charset=utf-8', 'Content-Length': '409', 'Connection': 'keep-alive', 'date': 'wed, 23 mar 2022 11:10:48 gmt', 'server': 'uvicorn', 'Content-Security-Policy': "default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data: cdnjs.cloudflare.com server.arcgisonline.com www.google.com www.gstatic.com www.google-analytics.com cdn.ckeditor.com cdn.jsdelivr.net unpkg.com fonts.googleapis.com fonts.gstatic.com ecotaxa.obs-vlfr.fr;frame-ancestors 'self';form-action 'self';"}
Response text: 
----------- BACK-END -------------
  File "/app/main.py", line 1612, in export_object_set
    rsp = sce.run(current_user)
  File "/app/API_operations/exports/ForProject.py", line 54, in run
    _user, _project = RightsBO.user_wants(self.session, current_user_id, Action.READ, self.req.project_id)
  File "/app/BO/Rights.py", line 67, in user_wants
    assert project.visible \
AssertionError: Not authorized
...
500 Server Error: INTERNAL SERVER ERROR for url: https://ecotaxa.obs-vlfr.fr/api/object_set/export
moi90 commented 2 years ago

Duplicate of #34