Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit 28d0b3f

Browse files
Tickets: show Manage links only for completed orders (#1184)
* closes 1160. Co-authored-by: Sebastian Witowski <sebawitowski@yahoo.com>
1 parent 1f45dbc commit 28d0b3f

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ You can access the admin pages using the `admin` username. You can login to the
6969
To start a server with the VS Code debugger enabled, run:
7070

7171
```bash
72-
$ docker -f docker-compose.yml -f docker-compose-vscode-debugger.yml up
72+
$ docker-compose -f docker-compose.yml -f docker-compose-vscode-debugger.yml up
7373
```
7474

7575
Next, run "Start Debugging" command in VS Code (otherwise, the `docker-compose up`

templates/ep19/bs/cart/_order_summary.html

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,26 @@ <h4>Summary</h4>
44
<tr>
55
<th>code</th>
66
<th>ticket</th>
7-
<th>&euro;</th>
8-
<th class='text-right'>Manage</th>
7+
{% if order.is_complete %}
8+
<th>&euro;</th>
9+
<th class='text-right'>Manage</th>
10+
{% else %}
11+
<th class='text-right'>&euro;</th>
12+
{% endif %}
913
</tr>
1014

1115
{% for item in order.orderitem_set.all %}
1216
<tr>
1317
<td>{{ item.code }}</td>
1418
<td>{% if item.ticket %}{{ item.ticket }}{% else %}{{ item.description }}{% endif %}</td>
15-
<td>{{ item.price }}</td>
16-
{% if item.ticket %}
17-
<td class='text-right'>
18-
<a class='btn btn-outline-primary' href='{% url "user_panel:manage_ticket" item.ticket.id %}'>Configure ticket</a>
19-
<a class='btn btn-outline-primary' href='{% url "user_panel:assign_ticket" item.ticket.id %}'>Assign ticket</a>
20-
</td>
19+
{% if order.is_complete %}
20+
<td>{{ item.price }}</td>
21+
<td class='text-right'>
22+
<a class='btn btn-outline-primary' href='{% url "user_panel:manage_ticket" item.ticket.id %}'>Configure ticket</a>
23+
<a class='btn btn-outline-primary' href='{% url "user_panel:assign_ticket" item.ticket.id %}'>Assign ticket</a>
24+
</td>
25+
{% else %}
26+
<td class='text-right'>{{ item.price }}</td>
2127
{% endif %}
2228

2329
</tr>

tests/test_cart.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,16 @@ def test_cart_computes_discounts_correctly(db, user_client):
378378
== (order_ticket_count * coupon_fare.price) * Decimal((100 - percent_discount)/100))
379379

380380

381+
@mark.xfail
382+
def test_manage_and_assign_ticket_urls_not_shown_in_step_3(db):
383+
assert False
384+
385+
386+
@mark.xfail
387+
def test_manage_and_assign_ticket_urls_not_shown_in_step_4(db):
388+
assert False
389+
390+
381391
@mark.xfail
382392
def test_cart_only_allows_to_buy_less_than_max_number_of_tickets(db):
383393
# TODO: This is now only enforced on the frontend - the backend implementation is missing

0 commit comments

Comments
 (0)