(self, *, raise_exception=False)
| 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 | """ |
no test coverage detected