extra changes for testing section complete
This commit is contained in:
parent
8164236513
commit
736f450013
1 changed files with 5 additions and 1 deletions
|
@ -210,13 +210,15 @@ def section(request, report_pk, section_pk):
|
||||||
|
|
||||||
# update section boolean to complete
|
# update section boolean to complete
|
||||||
complete = section_complete(section_pk)
|
complete = section_complete(section_pk)
|
||||||
|
s = Section.objects.get(id=section_pk)
|
||||||
if complete:
|
if complete:
|
||||||
s = Section.objects.get(id=section_pk)
|
# s = Section.objects.get(id=section_pk)
|
||||||
s.completed = True
|
s.completed = True
|
||||||
s.save()
|
s.save()
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"message": "Updated report {0}, section {1}.".format(report_pk, section_pk),
|
"message": "Updated report {0}, section {1}.".format(report_pk, section_pk),
|
||||||
|
"section completion": s.completed,
|
||||||
"request_data": request.data
|
"request_data": request.data
|
||||||
}
|
}
|
||||||
return JsonResponse(data)
|
return JsonResponse(data)
|
||||||
|
@ -237,6 +239,7 @@ def section_complete(section_pk):
|
||||||
return True
|
return True
|
||||||
elif i.field_type == "decimal":
|
elif i.field_type == "decimal":
|
||||||
if not(
|
if not(
|
||||||
|
i.data_decimal == 0.0 or
|
||||||
i.data_decimal == "" or
|
i.data_decimal == "" or
|
||||||
i.data_decimal is None
|
i.data_decimal is None
|
||||||
):
|
):
|
||||||
|
@ -261,6 +264,7 @@ def section_complete(section_pk):
|
||||||
return True
|
return True
|
||||||
elif i.field_type == "integer":
|
elif i.field_type == "integer":
|
||||||
if not(
|
if not(
|
||||||
|
i.data_integer == 0 or
|
||||||
i.data_integer == "" or
|
i.data_integer == "" or
|
||||||
i.data_integer is None
|
i.data_integer is None
|
||||||
):
|
):
|
||||||
|
|
Loading…
Reference in a new issue