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 Jan 24, 2018
1 parent 14b82fa commit f33e6f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/users/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ class VerifiedUser(permissions.BasePermission):
"""
Custom permission to only allow verified users
"""

def has_object_permission(self, request, view, obj):
return obj.verified
def has_permission(self, request, view):
return request.user.profile.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 f33e6f8

Please sign in to comment.