bug fix: staging site issue

This commit is contained in:
usmannasir
2025-09-22 13:31:20 +05:00
parent 26425dd397
commit fb16f4cf56
3 changed files with 80 additions and 2 deletions

View File

@@ -216,8 +216,21 @@ class WebsiteManager:
if DeleteID != None:
wstagingDelete = WPStaging.objects.get(pk=DeleteID, owner=WPobj)
# Get the associated staging WPSites and Websites records
staging_wpsite = wstagingDelete.wpsite
staging_website = staging_wpsite.owner
# Delete the WPStaging record first
wstagingDelete.delete()
# Delete the staging WPSites record
staging_wpsite.delete()
# Delete the staging Websites record and all associated data
from plogical.vhost import vhost
vhost.deleteVirtualHostConfigurations(staging_website.domain, staging_website.adminEmail, staging_website.package.packageName)
except BaseException as msg:
da = str(msg)