diff --git a/openslides/application/models.py b/openslides/application/models.py index 7d4719913..594c54f2b 100644 --- a/openslides/application/models.py +++ b/openslides/application/models.py @@ -315,28 +315,30 @@ class Application(models.Model, SlideMixin): actions = [] # check if user allowed to withdraw an application - if (self.status == "pub" - and self.number \ - and user == self.submitter) \ - or (self.status == "pub" \ - and self.number \ - and user.has_perm("application.can_manage_application")) \ - or (self.status == "per" \ - and user == self.submitter) \ - or (self.status == "per" \ - and user.has_perm("application.can_manage_application")): + if ((self.status == "pub" + and self.number + and user == self.submitter) + or (self.status == "pub" + and self.number + and user.has_perm("application.can_manage_application")) + or (self.status == "per" + and user == self.submitter) + or (self.status == "per" + and user.has_perm("application.can_manage_application"))): actions.append("wit") #Check if the user can review the application - if self.status == "rev" \ - and (self.submitter == user \ - or user.has_perm("application.can_manage_application")): + if (self.status == "rev" + and (self.submitter == user + or user.has_perm("application.can_manage_application"))): actions.append("pub") - try: + # Check if the user can support and unspoort the application - if self.status == "pub" \ - and user != self.submitter \ - and user not in self.supporter.all() \ - and getattr(user, 'profile', None): + try: + if (self.status == "pub" + and user != self.submitter + and user not in self.supporter.all() + and getattr(user, 'profile', None)): + print "es ist ok" actions.append("support") except Profile.DoesNotExist: pass diff --git a/openslides/application/templates/application/overview.html b/openslides/application/templates/application/overview.html index da596d70d..3db80705a 100644 --- a/openslides/application/templates/application/overview.html +++ b/openslides/application/templates/application/overview.html @@ -30,32 +30,32 @@ {{ applications|length }} {% trans "Applications" %}
{%trans "Number" %} | -{%trans "Application title" %} | - {% if min_supporters > 0 %} -{%trans "Number of supporters" %} | - {% endif %} -{%trans "Status" %} | -{%trans "Submitter" %} | -{%trans "Creation Time" %} | +{%trans "Number" %} | +{%trans "Application title" %} | + {% if min_supporters > 0 %} +{%trans "Number of supporters" %} | + {% endif %} +{%trans "Status" %} | +{%trans "Submitter" %} | +{%trans "Creation Time" %} |
---|---|---|---|---|---|---|---|---|---|---|---|
{% if application.number %}{{ application.number }}{% else %}-{% endif %} | -{{ application }} | +{% if application.number %}{{ application.number }}{% else %}-{% endif %} | +{{ application }} | {% if min_supporters > 0 %} -{{ application.supporter.count }} | +{{ application.supporter.count }} | {% endif %} -{% if application.status != "pub" %}
- {{ application.get_status_display }} - {% endif %} - {% for note in application.notes %} - {{ note }} - {% if not forloop.last %} {%endif%} - {% endfor %} - |
- {{ application.submitter.profile }} | -{{ application.creation_time }} | +{% if application.status != "pub" %}
+ {{ application.get_status_display }} + {% endif %} + {% for note in application.notes %} + {{ note }} + {% if not forloop.last %} {%endif%} + {% endfor %} + |
+ {{ application.submitter.profile }} | +{{ application.creation_time }} |