Revision 022cc8e2
b/snf-astakos-app/astakos/im/models.py | ||
---|---|---|
1596 | 1596 |
def has_pending_modifications(self): |
1597 | 1597 |
return bool(self.last_pending()) |
1598 | 1598 |
|
1599 |
def denied_modifications(self): |
|
1600 |
q = self.chained_applications() |
|
1601 |
q = q.filter(Q(state=self.DENIED)) |
|
1602 |
q = q.filter(~Q(id=self.id)) |
|
1603 |
return q |
|
1604 |
|
|
1605 |
def last_denied(self): |
|
1606 |
try: |
|
1607 |
return self.denied_modifications().order_by('-id')[0] |
|
1608 |
except IndexError: |
|
1609 |
return None |
|
1610 |
|
|
1611 |
def has_denied_modifications(self): |
|
1612 |
return bool(self.last_denied()) |
|
1613 |
|
|
1599 | 1614 |
def is_applied(self): |
1600 | 1615 |
try: |
1601 | 1616 |
self.project |
b/snf-astakos-app/astakos/im/templates/im/projects/project_detail.html | ||
---|---|---|
13 | 13 |
{% if object.has_pending_modifications %} - |
14 | 14 |
<a href="{% url astakos.im.views.project_app object.last_pending.pk %}"> |
15 | 15 |
MODIFICATION PENDING</a> |
16 |
{% else %} |
|
17 |
<!-- note that pending modifications have priority --> |
|
18 |
{% if object.has_denied_modifications %} - |
|
19 |
<a href="{% url astakos.im.views.project_app object.last_denied.pk %}"> |
|
20 |
MODIFICATION DENIED</a> |
|
21 |
{% endif %} |
|
16 | 22 |
{% endif %} |
17 | 23 |
{% else %} |
18 | 24 |
<!-- application view --> |
b/snf-astakos-app/astakos/im/views.py | ||
---|---|---|
1530 | 1530 |
|
1531 | 1531 |
# XXX: dismiss application also does authorization |
1532 | 1532 |
dismiss_application(application_id, request_user=request.user) |
1533 |
return redirect(reverse('project_list')) |
|
1533 |
|
|
1534 |
chain_id = None |
|
1535 |
chain_id = get_related_project_id(application_id) |
|
1536 |
if chain_id: |
|
1537 |
next = reverse('project_detail', args=(chain_id,)) |
|
1538 |
else: |
|
1539 |
next = reverse('project_list') |
|
1540 |
return redirect(next) |
|
1541 |
|
|
1534 | 1542 |
|
1535 | 1543 |
def landing(request): |
1536 | 1544 |
return render_response( |
Also available in: Unified diff