Advertisement
Guest User

Untitled

a guest
May 26th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. @classmethod
  2. def mutate_and_get_payload(cls, input, context, info):
  3. user = context.user
  4. old_password = input.get('old_password')
  5. new_password = input.get('new_password')
  6.  
  7. if user.has_usable_password():
  8. if not user.check_password(old_password):
  9. raise ResponseError(
  10. "Invalid Password",
  11. code='invalid_old_password')
  12. # ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement