bug fix: continue backups if website is deleted from main CP

This commit is contained in:
Usman Nasir
2021-09-24 16:07:07 +05:00
parent 4c94da1084
commit 9dc16251be

View File

@@ -292,6 +292,16 @@ class IncScheduler():
GDriveJobLogs(owner=items, status=backupSchedule.INFO, message='Starting backup job..').save()
for website in items.gdrivesites_set.all():
### If this website dont exists continue
try:
Websites.objects.get(domain=website.domain)
except:
continue
##
try:
GDriveJobLogs(owner=items, status=backupSchedule.INFO, message='Local backup creation started for %s..' % (website.domain)).save()
@@ -540,6 +550,15 @@ Automatic backup failed for %s on %s.
else:
domain = site.domain.domain
### If this website dont exists continue
try:
Websites.objects.get(domain=domain)
except:
continue
##
## Save currently backing domain in db, so that i can restart from here when prematurely killed
jobConfig['website'] = domain