Skip to content

Commit

Permalink
fix: spf record verification user_audit_log
Browse files Browse the repository at this point in the history
  • Loading branch information
cquintana92 committed Oct 16, 2024
1 parent 0ec67c7 commit 564ce14
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/custom_domain_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,16 @@ def validate_spf_records(
expected_spf_domain = self.get_expected_spf_domain(custom_domain)
if expected_spf_domain in spf_domains:
custom_domain.spf_verified = True
Session.commit()
return DomainValidationResult(success=True, errors=[])
else:
custom_domain.spf_verified = False
emit_user_audit_log(
user=custom_domain.user,
action=UserAuditLogAction.VerifyCustomDomain,
message=f"Verified SPF records for custom domain {custom_domain.id} ({custom_domain.domain})",
)
Session.commit()
return DomainValidationResult(success=True, errors=[])
else:
custom_domain.spf_verified = False
Session.commit()
txt_records = self._dns_client.get_txt_record(custom_domain.domain)
cleaned_records = self.__clean_spf_records(txt_records, custom_domain)
return DomainValidationResult(
Expand Down

0 comments on commit 564ce14

Please sign in to comment.