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
188 stars 87 forks source link

Don't show the tree photo sharing dialog if it is not appropriate #3217

Closed jwalgran closed 7 years ago

jwalgran commented 7 years ago

There are three tree photo upload situations where we do not want to show a social media sharing dialog after POSTing the image to the server.

Private instances are not handled by not rendering the dialog markup on the page unless the instance is public.

Invalid images are handled by checking the markup returned from the response for the presence of an error element. This is not ideal, but is easier that changing the way failures are reported vs. loading updated carousel markup.

Large images are intended to be blocked by Nginx before reaching Django. If they reach Django they will trigger a validation error, which will be handled the same way invalid images are handled.


Testing

Connects to #2930

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 83.904% when pulling a856ae9990bf22fc2fe7094b25d5b68b43ad45f9 on jwalgran:feature/skip-photo-share into f342ae25eb71dea0a0c2153a6da43c2419fbdfe4 on OpenTreeMap:develop.

jwalgran commented 7 years ago

@azavea-bot rebuild