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!
|
# Show warning when saving order and metricstorage date is inconistent with registered date!
|
||||||
# exclude from change list action, support for multiple exclusion
|
# 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):
|
elif is_service and isinstance(service, list):
|
||||||
nested = []
|
nested = []
|
||||||
format_nested(service, nested)
|
format_nested(service, nested)
|
||||||
current.append(nested)
|
current.append(nested[0])
|
||||||
is_service = False
|
is_service = False
|
||||||
else:
|
else:
|
||||||
is_service = False
|
is_service = False
|
||||||
|
@ -171,12 +171,13 @@ def delete_related_services(modeladmin, request, queryset):
|
||||||
else:
|
else:
|
||||||
objects_name = force_text(opts.verbose_name_plural)
|
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(
|
context = dict(
|
||||||
admin_site.each_context(request),
|
admin_site.each_context(request),
|
||||||
title=_("Are you sure?"),
|
title=_("Are you sure?"),
|
||||||
objects_name=objects_name,
|
objects_name=objects_name,
|
||||||
deletable_objects=[related_services],
|
deletable_objects=[related_services],
|
||||||
model_count=dict(collector.model_count).items(),
|
model_count=dict(model_count).items(),
|
||||||
queryset=queryset,
|
queryset=queryset,
|
||||||
opts=opts,
|
opts=opts,
|
||||||
action_checkbox_name=helpers.ACTION_CHECKBOX_NAME,
|
action_checkbox_name=helpers.ACTION_CHECKBOX_NAME,
|
||||||
|
|
|
@ -165,7 +165,7 @@ class DomainAdmin(AccountAdminMixin, ExtendedModelAdmin):
|
||||||
(_("SOA"), {
|
(_("SOA"), {
|
||||||
'classes': ('collapse',),
|
'classes': ('collapse',),
|
||||||
'description': _(
|
'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."),
|
"zone propagates to the secondary nameservers."),
|
||||||
'fields': ('serial', 'refresh', 'retry', 'expire', 'min_ttl'),
|
'fields': ('serial', 'refresh', 'retry', 'expire', 'min_ttl'),
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -289,7 +289,6 @@ class Record(models.Model):
|
||||||
SRV = 'SRV'
|
SRV = 'SRV'
|
||||||
TXT = 'TXT'
|
TXT = 'TXT'
|
||||||
SPF = 'SPF'
|
SPF = 'SPF'
|
||||||
SOA = 'SOA'
|
|
||||||
|
|
||||||
TYPE_CHOICES = (
|
TYPE_CHOICES = (
|
||||||
(MX, "MX"),
|
(MX, "MX"),
|
||||||
|
@ -300,7 +299,6 @@ class Record(models.Model):
|
||||||
(SRV, "SRV"),
|
(SRV, "SRV"),
|
||||||
(TXT, "TXT"),
|
(TXT, "TXT"),
|
||||||
(SPF, "SPF"),
|
(SPF, "SPF"),
|
||||||
(SOA, "SOA"),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
VALIDATORS = {
|
VALIDATORS = {
|
||||||
|
@ -312,7 +310,6 @@ class Record(models.Model):
|
||||||
TXT: (validate_ascii, validators.validate_quoted_record),
|
TXT: (validate_ascii, validators.validate_quoted_record),
|
||||||
SPF: (validate_ascii, validators.validate_quoted_record),
|
SPF: (validate_ascii, validators.validate_quoted_record),
|
||||||
SRV: (validators.validate_srv_record,),
|
SRV: (validators.validate_srv_record,),
|
||||||
SOA: (validators.validate_soa_record,),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
domain = models.ForeignKey(Domain, verbose_name=_("domain"), related_name='records')
|
domain = models.ForeignKey(Domain, verbose_name=_("domain"), related_name='records')
|
||||||
|
|
Loading…
Reference in New Issue