added test cases for deleted state; updated fetch_cache logic to properly handle deleted domains

This commit is contained in:
David Kennedy 2023-11-22 14:26:24 -05:00
parent eda9728177
commit 8300694a3a
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B
2 changed files with 31 additions and 69 deletions

View file

@ -1196,7 +1196,7 @@ class Domain(TimeStampedModel, DomainHelper):
logger.error(e)
logger.error(e.code)
raise e
if e.code == ErrorCode.OBJECT_DOES_NOT_EXIST:
if e.code == ErrorCode.OBJECT_DOES_NOT_EXIST and self.state != Domain.State.DELETED:
# avoid infinite loop
already_tried_to_create = True
self.dns_needed_from_unknown()