default version is the accepted Version
This commit is contained in:
parent
2c6c9b55ee
commit
572782befa
@ -353,13 +353,15 @@ class Application(models.Model):
|
|||||||
if name is title, text, reason or time,
|
if name is title, text, reason or time,
|
||||||
Return this attribute from the newest version of the application
|
Return this attribute from the newest version of the application
|
||||||
"""
|
"""
|
||||||
if name in ('title', 'text', 'reason', 'time'):
|
if name in ('title', 'text', 'reason', 'time', 'aid'):
|
||||||
try:
|
try:
|
||||||
return self.last_version.__dict__[name]
|
return self.permitted.__dict__[name]
|
||||||
except TypeError:
|
except TypeError:
|
||||||
raise AttributeError(name)
|
return self.last_version.__dict__[name]
|
||||||
|
#raise AttributeError(name)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise AttributeError(name)
|
return self.last_version.__dict__[name]
|
||||||
|
#raise AttributeError(name)
|
||||||
raise AttributeError(name)
|
raise AttributeError(name)
|
||||||
|
|
||||||
def gen_poll(self, user=None):
|
def gen_poll(self, user=None):
|
||||||
|
@ -362,6 +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
|
||||||
|
application.accept_version(aversion)
|
||||||
messages.success(request, _("Version accepted") )
|
messages.success(request, _("Version accepted") )
|
||||||
return redirect(reverse('application_view', args=[application.id]))
|
return redirect(reverse('application_view', args=[application.id]))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user