delete item, not application by releated agenda-items

This commit is contained in:
Oskar Hahn 2012-06-03 10:19:08 +02:00
parent 2e498403cb
commit 43e30057b3
3 changed files with 9 additions and 7 deletions

View File

@ -112,11 +112,13 @@ class Item(MPTTModel, SlideMixin):
* view
* delete
"""
if self.releated_sid:
return self.get_releated_slide().get_absolute_url(link)
if link == 'view':
if self.releated_sid:
return self.get_releated_slide().get_absolute_url(link)
return reverse('item_view', args=[str(self.id)])
if link == 'edit':
if self.releated_sid:
return self.get_releated_slide().get_absolute_url(link)
return reverse('item_edit', args=[str(self.id)])
if link == 'delete':
return reverse('item_delete', args=[str(self.id)])

View File

@ -668,7 +668,7 @@ class CreateAgendaItem(RedirectView):
self.item.save()
def get_redirect_url(self, **kwargs):
return reverse('item_view', args=[self.item.id])
return reverse('item_overview')
class ApplicationPDF(PDFView):

View File

@ -41,7 +41,7 @@ def get_slide_from_sid(sid, element=False):
if id is not None:
try:
object = SLIDE[key].model.objects.get(pk=id)
except SLIDE[key].DoesNotExist:
except SLIDE[key].model.DoesNotExist:
return None
if element:
return object