Skip to content

Commit

Permalink
Make tests happy
Browse files Browse the repository at this point in the history
  • Loading branch information
aviupadhyayula committed Jan 18, 2025
1 parent cb2c5db commit 52ca5c4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 7 additions & 7 deletions backend/clubs/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,19 +571,19 @@ class TicketTransactionPermission(permissions.BasePermission):
"""

def has_permission(self, request, view):
if request.user.is_superuser:
return True

event_id = request.query_params.get("event_id")
if not event_id:
return False

if not request.user.is_authenticated:
return False

if request.user.is_superuser:
return True

Check warning on line 578 in backend/clubs/permissions.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/permissions.py#L577-L578

Added lines #L577 - L578 were not covered by tests

if request.user.has_perm("clubs.manage_club"):
return True

Check warning on line 581 in backend/clubs/permissions.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/permissions.py#L580-L581

Added lines #L580 - L581 were not covered by tests

event_id = request.query_params.get("event_id", None)
if not event_id:
return False

Check warning on line 585 in backend/clubs/permissions.py

View check run for this annotation

Codecov / codecov/patch

backend/clubs/permissions.py#L583-L585

Added lines #L583 - L585 were not covered by tests

try:
event = Event.objects.get(id=event_id)
membership = find_membership_helper(request.user, event.club)
Expand Down
7 changes: 7 additions & 0 deletions backend/clubs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5975,6 +5975,13 @@ def refund(self, request, *args, **kwargs):
Marks the transaction as refunded, makes tickets available again,
and sends confirmation emails to the buyer and event organizer.
---
requestBody:
content:
application/json:
schema:
type: object
properties: {}
required: []
responses:
"200":
content:
Expand Down

0 comments on commit 52ca5c4

Please sign in to comment.