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" %} - - - {% if min_supporters > 0 %} - - {% endif %} - - - + + + {% if min_supporters > 0 %} + + {% endif %} + + + {% for application in applications %} - - + + {% if min_supporters > 0 %} - + {% endif %} - - - + + + {% empty %} diff --git a/openslides/application/templates/application/view.html b/openslides/application/templates/application/view.html index 66e80b0ac..3842b3593 100644 --- a/openslides/application/templates/application/view.html +++ b/openslides/application/templates/application/view.html @@ -64,6 +64,7 @@ {% endif %} {% endwith %} diff --git a/openslides/application/views.py b/openslides/application/views.py index 8aaa0423f..9d6b9e1c3 100644 --- a/openslides/application/views.py +++ b/openslides/application/views.py @@ -55,6 +55,7 @@ from utils.template import Tab from participant.api import gen_username, gen_password + @permission_required('application.can_see_application') @template('application/overview.html') def overview(request):
{%trans "Number" %}{%trans "Application title" %}{%trans "Number of supporters" %}{%trans "Status" %}{%trans "Submitter" %}{%trans "Creation Time" %}{%trans "Number" %}{%trans "Application title" %}{%trans "Number of supporters" %}{%trans "Status" %}{%trans "Submitter" %}{%trans "Creation Time" %}
{% if application.number %}{{ application.number }}{% else %}-{% endif %}{{ application }}{% if application.number %}{{ application.number }}{% else %}-{% endif %}{{ application }}{{ application.supporter.count }}{{ application.supporter.count }}{% 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 }}