diff --git a/machines/forms.py b/machines/forms.py index 8ca13311..36cd64f8 100644 --- a/machines/forms.py +++ b/machines/forms.py @@ -410,8 +410,9 @@ class DelTxtForm(FormRevMixin, Form): else: self.fields['txt'].queryset = Txt.objects.all() + class DNameForm(FormRevMixin, ModelForm): - """Ajout d'un DName pour une zone""" + """Add a DNAME entry for a zone""" class Meta: model = DName fields = '__all__' @@ -422,10 +423,10 @@ class DNameForm(FormRevMixin, ModelForm): class DelDNameForm(FormRevMixin, Form): - """Suppression d'un ou plusieurs DName""" + """Delete a set of DNAME entries""" dnames = forms.ModelMultipleChoiceField( queryset=Txt.objects.none(), - label="Enregistrements DName actuels", + label="Existing DNAME entries", widget=forms.CheckboxSelectMultiple ) @@ -438,7 +439,6 @@ class DelDNameForm(FormRevMixin, Form): self.fields['dnames'].queryset = DName.objects.all() - class SrvForm(FormRevMixin, ModelForm): """Ajout d'un srv pour une zone""" class Meta: diff --git a/machines/migrations/0088_dname.py b/machines/migrations/0088_dname.py index 2b9b457b..4cbeb492 100644 --- a/machines/migrations/0088_dname.py +++ b/machines/migrations/0088_dname.py @@ -10,7 +10,7 @@ import re2o.mixins class Migration(migrations.Migration): dependencies = [ - ('machines', '0087_merge_20180624_1648'), + ('machines', '0083_remove_duplicate_rights'), ] operations = [ @@ -22,7 +22,9 @@ class Migration(migrations.Migration): ('zone', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='machines.Extension')), ], options={ - 'permissions': (('view_dname', 'Peut voir un objet dname'),), + 'permissions': (('view_dname', 'Can see a dname object'),), + 'verbose_name': 'DNAME entry', + 'verbose_name_plural': 'DNAME entries' }, bases=(re2o.mixins.RevMixin, re2o.mixins.AclMixin, models.Model), ), diff --git a/machines/models.py b/machines/models.py index 6a300078..6344cf91 100644 --- a/machines/models.py +++ b/machines/models.py @@ -672,23 +672,23 @@ class Txt(RevMixin, AclMixin, models.Model): class DName(RevMixin, AclMixin, models.Model): - """ Un enregistrement DName, qui crée un alias depuis la zone spécifié vers l'extension""" - PRETTY_NAME = "Enregistrement DName" - + """A DNAME entry for the DNS.""" zone = models.ForeignKey('Extension', on_delete=models.PROTECT) alias = models.CharField(max_length=255) class Meta: permissions = ( - ("view_dname", "Peut voir un objet dname"), + ("view_dname", "Can see a dname object"), ) + verbose_name = "DNAME entry" + verbose_name_plural = "DNAME entries" def __str__(self): return str(self.zone) + " : " + str(self.alias) @cached_property def dns_entry(self): - """Renvoie l'enregisterment DNAME complet pour le fichier de zone""" + """Returns the DNAME record for the DNS zone file.""" return str(self.alias) + " IN DNAME " + str(self.zone) @@ -1702,19 +1702,22 @@ def text_post_save(**_kwargs): """Regeneration dns après modification d'un TXT""" regen('dns') + @receiver(post_delete, sender=Txt) def text_post_delete(**_kwargs): """Regeneration dns après modification d'un TX""" regen('dns') + @receiver(post_save, sender=DName) def dname_post_save(**_kwargs): - """Regeneration dns après modification d'un DName""" + """Updates the DNS regen after modification of a DName object.""" regen('dns') + @receiver(post_delete, sender=DName) -def DName_post_delete(**_kwargs): - """Regeneration dns après modification d'un DName""" +def dname_post_delete(**_kwargs): + """Updates the DNS regen after deletion of a DName object.""" regen('dns') diff --git a/machines/templates/machines/aff_dname.html b/machines/templates/machines/aff_dname.html index 2bd11994..17cd0457 100644 --- a/machines/templates/machines/aff_dname.html +++ b/machines/templates/machines/aff_dname.html @@ -3,7 +3,7 @@ Re2o est un logiciel d'administration développé initiallement au rezometz. Il se veut agnostique au réseau considéré, de manière à être installable en quelques clics. -Copyright © 2018 Charlie Jacomme +Copyright © 2018 Charlie Jacomme This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,21 +25,21 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Zone concernée | -Enregistrement | +Target zone | +Record | ||
---|---|---|---|---|---|
{{ dname.zone }} | -{{ dname.dns_entry }} | +{{ dname.zone }} | +{{ dname.dns_entry }} | - {% can_edit dname %} - {% include 'buttons/edit.html' with href='machines:edit-dname' id=dname.id %} - {% acl_end %} - {% include 'buttons/history.html' with href='machines:history' name='dname' id=dname.id %} + {% can_edit dname %} + {% include 'buttons/edit.html' with href='machines:edit-dname' id=dname.id %} + {% acl_end %} + {% include 'buttons/history.html' with href='machines:history' name='dname' id=dname.id %} |