Commits

Jason Goldstein committed 22dcab5

Make Delete a POST request.

Comments (0)

Files changed (2)

cropper/templates/cropper/crop.html

             {{ form.as_p }}
         </div>
         <div class="section controls">
-            <input class="button" type="submit" value="Save Crop">
-            <a class="button" href="#">Remove Crop</a>
-            <a class="del button" href="{% url change_theme userslug=site.project_name %}">Cancel</a>
+            <input class="button" name="save" type="submit" value="Save Crop" default>
+            
+            {% if coordinates %}            
+                <input class="button" type="submit" name="delete" value="Remove Copy">
+            {% endif %}
+
         </div>
     </form>
     
     obj = get_object_or_404(model, id=object_id)
 
     # So we can reuse this view, passing 'delete' in GET will kill it and abort
-    if 'delete' in request.GET:
+    if 'delete' in request.POST:
         crop = Crop.objects.filter(object_id=obj.id, content_type=ContentType.objects.get_for_model(obj), field=field)
         crop.delete()
         return redirect(delete_redirect or '/')