|
|
|
@ -85,11 +85,13 @@ class UserVerifyView(CreateAPIView): |
|
|
|
try: |
|
|
|
verify_data = RedisManager().get_by_redis(data['email']) |
|
|
|
if not verify_data: |
|
|
|
raise ExpiredCodeException("Verification data not found or expired.") |
|
|
|
raise ValidationError({"code": "Verification data not found or expired."}) |
|
|
|
# raise ExpiredCodeException("Verification data not found or expired.") |
|
|
|
except (ServiceUnavailableException) as e: |
|
|
|
return AppAPIException({"message": str(e)}, status_code=e.status_code) |
|
|
|
except ExpiredCodeException: |
|
|
|
raise ExpiredCodeException("The verification code has expired.") |
|
|
|
# raise ExpiredCodeException("The verification code has expired.") |
|
|
|
raise ValidationError({"code": "The verification code has expired."}) |
|
|
|
|
|
|
|
|
|
|
|
code = self.valied_code(data['code'], verify_data['code']) |
|
|
|
@ -110,7 +112,9 @@ class UserVerifyView(CreateAPIView): |
|
|
|
|
|
|
|
def valied_code(self, current_code, save_code): |
|
|
|
if (current_code and save_code) and ( current_code != save_code): |
|
|
|
raise InvaliedCodeVrify() |
|
|
|
# raise InvaliedCodeVrify() |
|
|
|
raise ValidationError({"code": "code notfound"}) |
|
|
|
|
|
|
|
return current_code |
|
|
|
|
|
|
|
def perform_create(self, *args, **kwargs): |
|
|
|
|