| 1096 | fields = '__all__' |
| 1097 | |
| 1098 | def is_valid(self, *, raise_exception=False): |
| 1099 | super().is_valid(raise_exception=raise_exception) |
| 1100 | code_cache_key = self.data.get('email') + ":" + self.data.get("type") |
| 1101 | code_cache_key_lock = code_cache_key + "_lock" |
| 1102 | ttl = cache.ttl(code_cache_key_lock, version=version) |
| 1103 | if ttl is not None and ttl > 0: |
| 1104 | raise AppApiException(500, _("Do not send emails again within {seconds} seconds").format( |
| 1105 | seconds=int(ttl.total_seconds()))) |
| 1106 | return True |
| 1107 | |
| 1108 | def send(self): |
| 1109 | """ |