- if granted:
- if request.has_key('updst'):
- UpdatedStatus = request['updst']
- else:
- return HttpResponse('missing status')
-
- # Update Data Run status in DB
- # Try get rec. If not found return 'entry not found + <fcid><runfolder>', if found try update and return updated
- try:
- rec = DataRun.objects.get(run_folder=runfolder)
- rec.run_status = UpdatedStatus
-
- #if there's a message update that too
- mytimestamp = datetime.now().__str__()
- mytimestamp = re.sub(pattern=":[^:]*$",repl="",string=mytimestamp)
- if request.has_key('msg'):
- rec.run_note += ", "+request['msg']+" ("+mytimestamp+")"
- else :
- if UpdatedStatus == '1':
- rec.run_note = "Started ("+mytimestamp+")"
-
- rec.save()
- output = "updated to:'"+DataRun.RUN_STATUS_CHOICES[int(UpdatedStatus)][1].__str__()+"'"
- except ObjectDoesNotExist:
- output = "entry not found: "+fcid+", "+runfolder
- else:
- output ="access denied.. u: "+user+", ClIP: "+ClIP
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ # Update Data Run status in DB
+ # Try get rec. If not found return 'entry not found + <fcid><runfolder>', if found try update and return updated
+ try:
+ rec = DataRun.objects.get(run_folder=runfolder)
+ rec.run_status = UpdatedStatus
+
+ #if there's a message update that too
+ mytimestamp = datetime.now().__str__()
+ mytimestamp = re.sub(pattern=":[^:]*$",repl="",string=mytimestamp)
+ if request.has_key('msg'):
+ rec.run_note += ", "+request['msg']+" ("+mytimestamp+")"
+ else :
+ if UpdatedStatus == '1':
+ rec.run_note = "Started ("+mytimestamp+")"
+
+ rec.save()
+ output = "Hello "+settings.ALLOWED_IPS[ClIP]+". Updated to:'"+DataRun.RUN_STATUS_CHOICES[int(UpdatedStatus)][1].__str__()+"'"
+ except ObjectDoesNotExist:
+ output = "entry not found: "+fcid+", "+runfolder
+