accept old application versions
This commit is contained in:
parent
a89bf9f49b
commit
2c6c9b55ee
@ -66,11 +66,10 @@ class Application(models.Model):
|
|||||||
"""
|
"""
|
||||||
accept a Version
|
accept a Version
|
||||||
"""
|
"""
|
||||||
if version.id > self.permitted.id:
|
self.permitted = version
|
||||||
self.permitted = version
|
self.save()
|
||||||
self.save()
|
version.rejected = False
|
||||||
return True
|
version.save()
|
||||||
return False
|
|
||||||
|
|
||||||
def reject_version(self, version):
|
def reject_version(self, version):
|
||||||
if version.id > self.permitted.id:
|
if version.id > self.permitted.id:
|
||||||
|
@ -128,7 +128,7 @@ def edit(request, application_id=None):
|
|||||||
messages.success(request, _('New application was successfully created.'))
|
messages.success(request, _('New application was successfully created.'))
|
||||||
else:
|
else:
|
||||||
messages.success(request, _('Application was successfully modified.'))
|
messages.success(request, _('Application was successfully modified.'))
|
||||||
|
|
||||||
if not 'apply' in request.POST:
|
if not 'apply' in request.POST:
|
||||||
return redirect(reverse('application_view', args=[application.id]))
|
return redirect(reverse('application_view', args=[application.id]))
|
||||||
if application_id is None:
|
if application_id is None:
|
||||||
@ -362,10 +362,7 @@ def view_poll(request, poll_id):
|
|||||||
def permit_version(request, aversion_id):
|
def permit_version(request, aversion_id):
|
||||||
aversion = AVersion.objects.get(pk=aversion_id)
|
aversion = AVersion.objects.get(pk=aversion_id)
|
||||||
application = aversion.application
|
application = aversion.application
|
||||||
if application.accept_version(aversion):
|
messages.success(request, _("Version accepted") )
|
||||||
messages.success(request, _("Version accepted") )
|
|
||||||
else:
|
|
||||||
messages.error(request, _("ERROR by accepting the Version") )
|
|
||||||
return redirect(reverse('application_view', args=[application.id]))
|
return redirect(reverse('application_view', args=[application.id]))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user