You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
padelclub_backend/api/permissions.py

11 lines
319 B

from rest_framework import permissions
class IsClubOwner(permissions.BasePermission):
def has_object_permission(self, request, view, club):
# Check if the request user is the owner of the club
# print(club.creator.id)
# print(request.user.id)
return club.creator == request.user