Browse Source

Remove pinry.pins.views.delete_pin

REST API should be used to delete pins anyway, so remove the old code
that is not being used.
tags/v1.0.0
Krzysztof Klimonda 11 years ago
parent
commit
4f2b94616c
2 changed files with 0 additions and 16 deletions
  1. +0
    -1
      pinry/pins/urls.py
  2. +0
    -15
      pinry/pins/views.py

+ 0
- 1
pinry/pins/urls.py View File

@@ -8,5 +8,4 @@ urlpatterns = patterns('pinry.pins.views',
url(r'^$', RecentPins.as_view(), name='recent-pins'),
url(r'^tag/.+/$', RecentPins.as_view(), name='tag'),
url(r'^new-pin/$', NewPin.as_view(), name='new-pin'),
url(r'^delete-pin/(?P<pin_id>\d+)/$', 'delete_pin', name='delete-pin'),
)

+ 0
- 15
pinry/pins/views.py View File

@@ -29,18 +29,3 @@ class NewPin(CreateView):
def form_invalid(self, form):
messages.error(self.request, 'Pin did not pass validation!')
return super(NewPin, self).form_invalid(form)


def delete_pin(request, pin_id):
try:
pin = Pin.objects.get(id=pin_id)
if pin.submitter == request.user:
pin.delete()
messages.success(request, 'Pin successfully deleted.')
else:
messages.error(request, 'You are not the submitter and can not '
'delete this pin.')
except Pin.DoesNotExist:
messages.error(request, 'Pin with the given id does not exist.')

return HttpResponseRedirect(reverse('pins:recent-pins'))

Loading…
Cancel
Save