OpenTreeMap / otm-core

OpenTreeMap is a collaborative platform for crowdsourced tree inventory, ecosystem services calculations, urban forestry analysis, and community engagement.
www.opentreemap.org
Other
187 stars 88 forks source link

Cannot remove edited photos from the photo moderation page #2341

Open maurizi opened 8 years ago

maurizi commented 8 years ago

If you rotate a previously approved photo and it will get stuck in the management UI

  1. On the tree detail page add a photo
  2. On the management page approve the photo
  3. On the tree detail page, rotate the photo

The rotated photo will appear on the management page, but clicking "Approve" or "Reject" generates a 500

Internal Server Error: /myinstance/features/1110498/photo/8030/approve
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/http.py", line 45, in inner
    return func(request, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/decorators.py", line 22, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/opt/app/core/opentreemap/treemap/decorators.py", line 45, in wrapper
    return view_fn(request, instance, *args, **kwargs)
  File "/opt/app/core/opentreemap/treemap/decorators.py", line 69, in f
    return view_fn(request, instance, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django_tinsel/decorators.py", line 79, in wrapper
    params = callable_or_dict(request, *args, **wrapper_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line 145, in inner
    return func(*args, **kwargs)
  File "/opt/app/core/opentreemap/treemap/views/photo.py", line 112, in approve_or_reject_photo
    audit, request.user, approved)
  File "/opt/app/core/opentreemap/treemap/audit.py", line 221, in approve_or_reject_existing_edit
    raise Exception('This audit has already been approved or rejected')
maurizi commented 8 years ago

One option for fixing this is to prevent photos from reappearing on the review page when rotating them.

dboyer commented 8 years ago

Redoing the photo management page changed but did not fix this issue. Steps:

  1. Added a photo to a detail page
  2. On photo management page, I archived that photo
  3. On detail page, I rotated the photo
  4. On photo management page, the photo appeared on the main page again and nothing happened when I tried to archive or delete it