From 48ec3d353efd719e1343f1bf88e07b60a0d73e85 Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Sat, 12 Oct 2019 17:22:51 +0200 Subject: [PATCH] default ttl to 0 --- machines/migrations/0103_auto_20191002_2222.py | 4 ++-- machines/models.py | 7 ++----- ..._dns_ttl.py => 0066_optionalmachine_default_dns_ttl.py} | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) rename preferences/migrations/{0064_optionalmachine_default_dns_ttl.py => 0066_optionalmachine_default_dns_ttl.py} (90%) diff --git a/machines/migrations/0103_auto_20191002_2222.py b/machines/migrations/0103_auto_20191002_2222.py index ef0bc830..43adac74 100644 --- a/machines/migrations/0103_auto_20191002_2222.py +++ b/machines/migrations/0103_auto_20191002_2222.py @@ -10,14 +10,14 @@ class Migration(migrations.Migration): dependencies = [ ('machines', '0102_auto_20190303_1611'), - ('preferences', '0064_optionalmachine_default_dns_ttl'), + ('preferences', '0066_optionalmachine_default_dns_ttl'), ] operations = [ migrations.AddField( model_name='domain', name='ttl', - field=models.PositiveIntegerField(default=machines.models.get_default_ttl, verbose_name='Time To Live (TTL)'), + field=models.PositiveIntegerField(default=0, verbose_name='Time To Live (TTL)'), ), migrations.AddField( model_name='mx', diff --git a/machines/models.py b/machines/models.py index 708dd8c9..ca881033 100644 --- a/machines/models.py +++ b/machines/models.py @@ -1560,10 +1560,6 @@ class Ipv6List(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): return str(self.ipv6) -def get_default_ttl(): - return preferences.models.OptionalMachine.get_cached_value('default_dns_ttl') - - class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): """ Objet domain. Enregistrement A et CNAME en même temps : permet de stocker les alias et les nom de machines, suivant si interface_parent @@ -1588,7 +1584,8 @@ class Domain(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): ) ttl = models.PositiveIntegerField( verbose_name=_("Time To Live (TTL)"), - default=get_default_ttl + default=0 # 0 means that the re2o-service for DNS should retrieve the + # default TTL ) class Meta: diff --git a/preferences/migrations/0064_optionalmachine_default_dns_ttl.py b/preferences/migrations/0066_optionalmachine_default_dns_ttl.py similarity index 90% rename from preferences/migrations/0064_optionalmachine_default_dns_ttl.py rename to preferences/migrations/0066_optionalmachine_default_dns_ttl.py index f87cafca..47e3519e 100644 --- a/preferences/migrations/0064_optionalmachine_default_dns_ttl.py +++ b/preferences/migrations/0066_optionalmachine_default_dns_ttl.py @@ -8,7 +8,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('preferences', '0063_mandate'), + ('preferences', '0065_auto_20191010_1227'), ] operations = [