Fixed delete account related services
This commit is contained in:
parent
62fd85a987
commit
21ff73afea
2
TODO.md
2
TODO.md
|
@ -452,3 +452,5 @@ mkhomedir_helper or create ssh homes with bash.rc and such
|
|||
|
||||
# Show warning when saving order and metricstorage date is inconistent with registered date!
|
||||
# exclude from change list action, support for multiple exclusion
|
||||
|
||||
# breadcrumbs https://orchestra.pangea.org/admin/domains/domain/?account_id=930
|
||||
|
|
|
@ -131,7 +131,7 @@ def delete_related_services(modeladmin, request, queryset):
|
|||
elif is_service and isinstance(service, list):
|
||||
nested = []
|
||||
format_nested(service, nested)
|
||||
current.append(nested)
|
||||
current.append(nested[0])
|
||||
is_service = False
|
||||
else:
|
||||
is_service = False
|
||||
|
@ -171,12 +171,13 @@ def delete_related_services(modeladmin, request, queryset):
|
|||
else:
|
||||
objects_name = force_text(opts.verbose_name_plural)
|
||||
|
||||
model_count = {model._meta.verbose_name_plural: len(objs) for model, objs in collector.model_objs.items()}
|
||||
context = dict(
|
||||
admin_site.each_context(request),
|
||||
title=_("Are you sure?"),
|
||||
objects_name=objects_name,
|
||||
deletable_objects=[related_services],
|
||||
model_count=dict(collector.model_count).items(),
|
||||
model_count=dict(model_count).items(),
|
||||
queryset=queryset,
|
||||
opts=opts,
|
||||
action_checkbox_name=helpers.ACTION_CHECKBOX_NAME,
|
||||
|
|
|
@ -165,7 +165,7 @@ class DomainAdmin(AccountAdminMixin, ExtendedModelAdmin):
|
|||
(_("SOA"), {
|
||||
'classes': ('collapse',),
|
||||
'description': _(
|
||||
"SOA (Start of Authority) records are used to determine how your "
|
||||
"SOA (Start of Authority) records are used to determine how the "
|
||||
"zone propagates to the secondary nameservers."),
|
||||
'fields': ('serial', 'refresh', 'retry', 'expire', 'min_ttl'),
|
||||
}),
|
||||
|
|
|
@ -289,7 +289,6 @@ class Record(models.Model):
|
|||
SRV = 'SRV'
|
||||
TXT = 'TXT'
|
||||
SPF = 'SPF'
|
||||
SOA = 'SOA'
|
||||
|
||||
TYPE_CHOICES = (
|
||||
(MX, "MX"),
|
||||
|
@ -300,7 +299,6 @@ class Record(models.Model):
|
|||
(SRV, "SRV"),
|
||||
(TXT, "TXT"),
|
||||
(SPF, "SPF"),
|
||||
(SOA, "SOA"),
|
||||
)
|
||||
|
||||
VALIDATORS = {
|
||||
|
@ -312,7 +310,6 @@ class Record(models.Model):
|
|||
TXT: (validate_ascii, validators.validate_quoted_record),
|
||||
SPF: (validate_ascii, validators.validate_quoted_record),
|
||||
SRV: (validators.validate_srv_record,),
|
||||
SOA: (validators.validate_soa_record,),
|
||||
}
|
||||
|
||||
domain = models.ForeignKey(Domain, verbose_name=_("domain"), related_name='records')
|
||||
|
|
Loading…
Reference in New Issue