Skip to content

Commit

Permalink
Remove useless permissions check code from users resource.
Browse files Browse the repository at this point in the history
The permissions sistem handles well these conditions.
  • Loading branch information
Andrey Antukh committed Sep 25, 2014
1 parent 7bdab61 commit aa45781
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions taiga/users/api.py
Expand Up @@ -67,27 +67,6 @@ class UsersViewSet(ModelCrudViewSet):
def create(self, *args, **kwargs):
raise exc.NotSupported()

def pre_conditions_on_save(self, obj):
if self.request.user.is_superuser:
return

if obj.id == self.request.user.id:
return

if obj.id is None:
return

raise exc.PreconditionError()

def pre_conditions_on_delete(self, obj):
if self.request.user.is_superuser:
return

if obj.id == self.request.user.id:
return

raise exc.PreconditionError()

@list_route(methods=["POST"])
def password_recovery(self, request, pk=None):
username_or_email = request.DATA.get('username', None)
Expand Down

0 comments on commit aa45781

Please sign in to comment.