Skip to content

Commit

Permalink
fix shift change button missing
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrindt committed Dec 13, 2024
1 parent 815fba1 commit 481a19a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ephios/core/templates/core/fragments/shift_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</div>
{% endwith %}

{% if "change_event" in event_perms %}
{% if can_change_event %}
<div class="dropstart">
<button class="btn" type="button" id="actionDropdownButton"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down
28 changes: 14 additions & 14 deletions tests/core/test_event_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ def test_show_disposition_button(django_app, volunteer, planner, event):


def test_edit_permissions(django_app, volunteer, manager, groups, event):
assert (
"Add another shift"
not in django_app.get(
reverse("core:event_detail", kwargs=dict(pk=event.pk, slug="nottheactualslug")),
user=volunteer,
).follow()
)
assert (
"Add another shift"
in django_app.get(
reverse("core:event_detail", kwargs=dict(pk=event.pk, slug="nottheactualslug")),
user=manager,
).follow()
)
shift_id = event.shifts.first().pk
response = django_app.get(
reverse("core:event_detail", kwargs=dict(pk=event.pk, slug="nottheactualslug")),
user=volunteer,
).follow()
assert "Add another shift" not in response
assert "Edit" not in response.html.find(id=f"shift-{shift_id}").text

response = django_app.get(
reverse("core:event_detail", kwargs=dict(pk=event.pk, slug="nottheactualslug")),
user=manager,
).follow()
assert "Add another shift" in response
assert "Edit" in response.html.find(id=f"shift-{shift_id}").text

0 comments on commit 481a19a

Please sign in to comment.