Removing a domain: domain may not have tokens.
This commit is contained in:
parent
de8beb0df8
commit
5cbcbdaa8f
2
Makefile
2
Makefile
@ -11,7 +11,7 @@ endif
|
||||
# No idea why, but I need that to run applications. Ignore that.
|
||||
#LD_P ?= LD_PRELOAD=/usr/local/lib/libipc.so.0
|
||||
|
||||
OPTS ?= --progress --no-debug
|
||||
OPTS ?= --progress
|
||||
|
||||
Q ?= @
|
||||
|
||||
|
@ -334,12 +334,14 @@ class DNSManager::Storage
|
||||
return Response::DomainDeleted.new domain_name
|
||||
end
|
||||
|
||||
# Remove this domain_name from the list of user's domains.
|
||||
domains_by_name.delete domain_name
|
||||
|
||||
# Remove the related zone and their registered tokens.
|
||||
zones_by_domain.delete domain_name
|
||||
tokens_by_domain.delete domain_name
|
||||
|
||||
# The domain may not have tokens.
|
||||
tokens_by_domain.delete? domain_name
|
||||
|
||||
# Remove this domain_name from the list of user's domains.
|
||||
domains_by_name.delete domain_name
|
||||
|
||||
Response::DomainDeleted.new domain_name
|
||||
end
|
||||
@ -382,9 +384,10 @@ class DNSManager::Storage
|
||||
|
||||
# Remove the user's domain when he is the only owner.
|
||||
if domain_cloned.owners.empty?
|
||||
@domains_by_name.delete domain_cloned.name
|
||||
@tokens_by_domain.delete domain_cloned.name
|
||||
@zones_by_domain.delete domain_cloned.name
|
||||
# The domain may not have tokens.
|
||||
@tokens_by_domain.delete? domain_cloned.name
|
||||
@zones_by_domain.delete domain_cloned.name
|
||||
@domains_by_name.delete domain_cloned.name
|
||||
else
|
||||
@domains_by_name.update domain_cloned
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user