feature: edit incremental backup plans

This commit is contained in:
Usman Nasir
2020-01-21 22:10:58 +05:00
parent 4e783f0a2f
commit be4b85cbe3
5 changed files with 251 additions and 2 deletions

View File

@@ -678,6 +678,42 @@ def getCurrentBackupSchedules(request):
dic = {'id': items.id,
'destination': items.destination,
'frequency': items.frequency,
'numberOfSites': items.jobsites_set.all().count()
}
if checker == 0:
json_data = json_data + json.dumps(dic)
checker = 1
else:
json_data = json_data + ',' + json.dumps(dic)
json_data = json_data + ']'
final_json = json.dumps({'status': 1, 'error_message': "None", "data": json_data})
return HttpResponse(final_json)
except BaseException as msg:
final_dic = {'status': 0, 'error_message': str(msg)}
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def fetchSites(request):
try:
userID = request.session['userID']
currentACL = ACLManager.loadedACL(userID)
if ACLManager.currentContextPermission(currentACL, 'scheDuleBackups') == 0:
return ACLManager.loadErrorJson('fetchStatus', 0)
data = json.loads(request.body)
job = BackupJob.objects.get(pk=data['id'])
json_data = "["
checker = 0
for items in job.jobsites_set.all():
dic = {'id': items.id,
'website': items.website,
}
if checker == 0: