From 4cd1ad5954c030eaee573d5e760ce87553cb2747 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 19 Sep 2012 11:58:24 +0200 Subject: [PATCH 1/3] Fixed missing supporters number --- openslides/application/templates/application/overview.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openslides/application/templates/application/overview.html b/openslides/application/templates/application/overview.html index 2291b55ac..45bc6a619 100644 --- a/openslides/application/templates/application/overview.html +++ b/openslides/application/templates/application/overview.html @@ -49,7 +49,7 @@ {% if application.number %}{{ application.number }}{% else %}-{% endif %} {{ application.public_version.title }} {% if min_supporters > 0 %} - {{ application.supporter.count }} + {{ application.count_supporters }} {% endif %} {% if application.status != "pub" %} {{ application.get_status_display }}
From 9f9ea81fc698c5ec0adfbeb06eef90328a795d3b Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 19 Sep 2012 14:16:17 +0200 Subject: [PATCH 2/3] Fixed attribute error if anonymous opens application/assignment view. --- openslides/application/models.py | 5 ++++- openslides/assignment/models.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/openslides/application/models.py b/openslides/application/models.py index df1d8195f..bac0f47f0 100644 --- a/openslides/application/models.py +++ b/openslides/application/models.py @@ -164,7 +164,10 @@ class Application(models.Model, SlideMixin): yield object.person def is_supporter(self, person): - return self.applicationsupporter_set.filter(person=person).exists() + try: + return self.applicationsupporter_set.filter(person=person).exists() + except AttributeError: + return False @property def enough_supporters(self): diff --git a/openslides/assignment/models.py b/openslides/assignment/models.py index dcd8a6e15..19c9886bf 100644 --- a/openslides/assignment/models.py +++ b/openslides/assignment/models.py @@ -122,8 +122,11 @@ class Assignment(models.Model, SlideMixin): """ return True, if person is a candidate. """ - return self.assignment_candidats.filter(person=person) \ + try: + return self.assignment_candidats.filter(person=person) \ .exclude(blocked=True).exists() + except AttributeError: + return False def is_blocked(self, person): """ From a60f03aebc0a08ea724363425979107ff22855f7 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Wed, 19 Sep 2012 17:00:40 +0200 Subject: [PATCH 3/3] Fixed: Application is deleted if user clicks 'No' in confirm form. --- openslides/application/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openslides/application/views.py b/openslides/application/views.py index 5b8e3dcce..cc9b18bd5 100644 --- a/openslides/application/views.py +++ b/openslides/application/views.py @@ -466,7 +466,7 @@ class ApplicationDelete(DeleteView): elif self.object: if not 'delete' in self.object.get_allowed_actions(user=request.user): messages.error(request, _("You can not delete motion %s.") % self.object) - else: + elif self.get_answer() == 'yes': title = self.object.title self.object.delete(force=True) messages.success(request, _("Motion %s was successfully deleted.") % title)