MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / is_valid

Method is_valid

apps/users/serializers/user.py:1006–1016  ·  view source on GitHub ↗
(self, *, raise_exception=False)

Source from the content-addressed store, hash-verified

1004 fields = '__all__'
1005
1006 def is_valid(self, *, raise_exception=False):
1007 super().is_valid(raise_exception=True)
1008 email = self.data.get("email")
1009 cache_code = cache.get(get_key(email + ':reset_password'), version=version)
1010 if self.data.get('password') != self.data.get('re_password'):
1011 raise AppApiException(ExceptionCodeConstants.PASSWORD_NOT_EQ_RE_PASSWORD.value.code,
1012 ExceptionCodeConstants.PASSWORD_NOT_EQ_RE_PASSWORD.value.message)
1013 if cache_code != self.data.get('code'):
1014 raise AppApiException(ExceptionCodeConstants.CODE_ERROR.value.code,
1015 ExceptionCodeConstants.CODE_ERROR.value.message)
1016 return True
1017
1018 def reset_password(self):
1019 """

Callers 1

reset_passwordMethod · 0.95

Calls 3

AppApiExceptionClass · 0.90
is_validMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected