Skip to content

Commit

Permalink
actually made it work
Browse files Browse the repository at this point in the history
  • Loading branch information
marktai committed Mar 13, 2018
1 parent 14b82fa commit 696261c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/users/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ class VerifiedUser(permissions.BasePermission):
"""
Custom permission to only allow verified users
"""
def has_permission(self, request, view):
return request.user.profile.verified

def has_object_permission(self, request, view, obj):
return obj.verified
2 changes: 1 addition & 1 deletion src/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class OwnMentorView(generics.RetrieveUpdateDestroyAPIView):
"""
View for turning mentor status on (post) and modifying all mentor fields
"""
permission_classes = tuple()
permission_classes = (VerifiedUser,)
serializer_class = MentorSerializer

def get_object(self):
Expand Down

0 comments on commit 696261c

Please sign in to comment.