From 572782befa5b321773d81bf76978ffece95da1b3 Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Sun, 4 Sep 2011 10:21:54 +0200 Subject: [PATCH] default version is the accepted Version --- openslides/application/models.py | 10 ++++++---- openslides/application/views.py | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openslides/application/models.py b/openslides/application/models.py index e45215fb1..ebeb6ccbc 100644 --- a/openslides/application/models.py +++ b/openslides/application/models.py @@ -353,13 +353,15 @@ class Application(models.Model): if name is title, text, reason or time, 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: - return self.last_version.__dict__[name] + return self.permitted.__dict__[name] except TypeError: - raise AttributeError(name) + return self.last_version.__dict__[name] + #raise AttributeError(name) except AttributeError: - raise AttributeError(name) + return self.last_version.__dict__[name] + #raise AttributeError(name) raise AttributeError(name) def gen_poll(self, user=None): diff --git a/openslides/application/views.py b/openslides/application/views.py index 416121427..d9820a5ef 100644 --- a/openslides/application/views.py +++ b/openslides/application/views.py @@ -362,6 +362,7 @@ def view_poll(request, poll_id): def permit_version(request, aversion_id): aversion = AVersion.objects.get(pk=aversion_id) application = aversion.application + application.accept_version(aversion) messages.success(request, _("Version accepted") ) return redirect(reverse('application_view', args=[application.id]))