delete item, not application by releated agenda-items
This commit is contained in:
parent
2e498403cb
commit
43e30057b3
@ -112,11 +112,13 @@ class Item(MPTTModel, SlideMixin):
|
|||||||
* view
|
* view
|
||||||
* delete
|
* delete
|
||||||
"""
|
"""
|
||||||
if self.releated_sid:
|
|
||||||
return self.get_releated_slide().get_absolute_url(link)
|
|
||||||
if link == 'view':
|
if link == 'view':
|
||||||
|
if self.releated_sid:
|
||||||
|
return self.get_releated_slide().get_absolute_url(link)
|
||||||
return reverse('item_view', args=[str(self.id)])
|
return reverse('item_view', args=[str(self.id)])
|
||||||
if link == 'edit':
|
if link == 'edit':
|
||||||
|
if self.releated_sid:
|
||||||
|
return self.get_releated_slide().get_absolute_url(link)
|
||||||
return reverse('item_edit', args=[str(self.id)])
|
return reverse('item_edit', args=[str(self.id)])
|
||||||
if link == 'delete':
|
if link == 'delete':
|
||||||
return reverse('item_delete', args=[str(self.id)])
|
return reverse('item_delete', args=[str(self.id)])
|
||||||
|
@ -124,13 +124,13 @@ def overview(request):
|
|||||||
# is not callable from within djangos templates..
|
# is not callable from within djangos templates..
|
||||||
for (i, application) in enumerate(applications):
|
for (i, application) in enumerate(applications):
|
||||||
try:
|
try:
|
||||||
applications[i] = {
|
applications[i] = {
|
||||||
'actions' : application.get_allowed_actions(request.user),
|
'actions' : application.get_allowed_actions(request.user),
|
||||||
'application' : application
|
'application' : application
|
||||||
}
|
}
|
||||||
except:
|
except:
|
||||||
# todo: except what?
|
# todo: except what?
|
||||||
applications[i] = {
|
applications[i] = {
|
||||||
'actions' : [],
|
'actions' : [],
|
||||||
'application' : application
|
'application' : application
|
||||||
}
|
}
|
||||||
@ -463,7 +463,7 @@ class ApplicationDelete(DeleteView):
|
|||||||
|
|
||||||
def gen_confirm_form(self, request, message, url):
|
def gen_confirm_form(self, request, message, url):
|
||||||
formbase = '%s<form action="%s" method="post"><input type="hidden" value="%s" name="csrfmiddlewaretoken">' % (message, url, csrf(request)['csrf_token'])
|
formbase = '%s<form action="%s" method="post"><input type="hidden" value="%s" name="csrfmiddlewaretoken">' % (message, url, csrf(request)['csrf_token'])
|
||||||
|
|
||||||
if len(self.applications):
|
if len(self.applications):
|
||||||
for application in self.applications:
|
for application in self.applications:
|
||||||
formbase += '<input type="hidden" name="application_ids" value="%s">' % application.id
|
formbase += '<input type="hidden" name="application_ids" value="%s">' % application.id
|
||||||
@ -668,7 +668,7 @@ class CreateAgendaItem(RedirectView):
|
|||||||
self.item.save()
|
self.item.save()
|
||||||
|
|
||||||
def get_redirect_url(self, **kwargs):
|
def get_redirect_url(self, **kwargs):
|
||||||
return reverse('item_view', args=[self.item.id])
|
return reverse('item_overview')
|
||||||
|
|
||||||
|
|
||||||
class ApplicationPDF(PDFView):
|
class ApplicationPDF(PDFView):
|
||||||
|
@ -41,7 +41,7 @@ def get_slide_from_sid(sid, element=False):
|
|||||||
if id is not None:
|
if id is not None:
|
||||||
try:
|
try:
|
||||||
object = SLIDE[key].model.objects.get(pk=id)
|
object = SLIDE[key].model.objects.get(pk=id)
|
||||||
except SLIDE[key].DoesNotExist:
|
except SLIDE[key].model.DoesNotExist:
|
||||||
return None
|
return None
|
||||||
if element:
|
if element:
|
||||||
return object
|
return object
|
||||||
|
Loading…
Reference in New Issue
Block a user