mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-09-17 15:52:30 +00:00
Merge pull request #1380 from raunz/preserve_history
Preserve domain records history after domain deletion
This commit is contained in:
@@ -549,11 +549,12 @@ class Domain(db.Model):
|
||||
domain.apikeys[:] = []
|
||||
|
||||
# Remove history for domain
|
||||
domain_history = History.query.filter(
|
||||
History.domain_id == domain.id
|
||||
)
|
||||
if domain_history:
|
||||
domain_history.delete()
|
||||
if not Setting().get('preserve_history'):
|
||||
domain_history = History.query.filter(
|
||||
History.domain_id == domain.id
|
||||
)
|
||||
if domain_history:
|
||||
domain_history.delete()
|
||||
|
||||
# then remove domain
|
||||
Domain.query.filter(Domain.name == domain_name).delete()
|
||||
|
Reference in New Issue
Block a user