some fixes

This commit is contained in:
Oskar Hahn 2012-04-15 13:10:24 +02:00
parent b620c0afb7
commit 91c9e1e9ab
4 changed files with 44 additions and 39 deletions

View File

@ -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

View File

@ -64,6 +64,7 @@
{% endif %}
<ul class="results">
{% for poll in polls %}
{% if perms.application.can_manage_application or poll.has_votes %}
<li>
{% if perms.application.can_manage_application %}
<a href="{% url application_poll_view poll.id %}">
@ -101,6 +102,7 @@
{% endif %}
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% endwith %}

View File

@ -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):