Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
  • Loading branch information
flotho committed Oct 23, 2023
1 parent 6836fad commit 6ebe60e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 2 additions & 5 deletions base_dns_infrastructure/models/dns_domain_zone/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DNSDomainZone(models.Model):
state = fields.Selection(
[
("draft", "Draft"),
("active", "Active"),
("production", "Production"),
("exception", "Exception"),
("inactive", "Inactive"),
],
Expand Down Expand Up @@ -71,10 +71,7 @@ def _check_valid_domain_name(self):
_('"%s" is not a valid FQDN') % (record.complete_name,)
)

@api.depends(
"name",
"parent_id.complete_name",
)
@api.depends("name", "parent_id")
def _compute_complete_name(self):
for record in self:
if record.parent_id:
Expand Down
4 changes: 3 additions & 1 deletion base_dns_infrastructure/models/dns_record/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class DNSRecord(models.Model):
default=60,
help="Time to Live, in seconds. Scope: 1-604800",
required=True,
string="TTL",
)

@api.depends(
Expand All @@ -53,9 +54,10 @@ class DNSRecord(models.Model):
)
def _compute_complete_name(self):
for record in self:
record.complete_name = "%s [%s]" % (
record.complete_name = "%s [%s]: %s" % (
record.zone_id.complete_name,
record.type_id.code,
record.value,
)

@api.constrains("type_id", "value")
Expand Down

0 comments on commit 6ebe60e

Please sign in to comment.