Skip to content

Commit

Permalink
debug: dump variables in submit_image_mutation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pphetra committed Jun 17, 2024
1 parent 0ba7dc5 commit 2772333
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions reports/schema/mutations/submit_image_mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,40 @@ def mutate(root, info, report_id, image, is_cover, image_id):
is_followup_report = False
is_subject_record = False
is_monitoring_record = False
print("report_id", report_id)
print("image_id", image_id)

try:
report = IncidentReport.objects.get(pk=report_id)
is_incident_report = True
except IncidentReport.DoesNotExist:
...
print("IncidentReport.DoesNotExist")

if not report:
try:
report = FollowUpReport.objects.get(pk=report_id)
is_followup_report = True
except FollowUpReport.DoesNotExist:
...
print("FollowUpReport.DoesNotExist")

if not report:
try:
report = SubjectRecord.objects.get(pk=report_id)
is_subject_record = True
except SubjectRecord.DoesNotExist:
...
print("SubjectRecord.DoesNotExist")

if not report:
try:
report = MonitoringRecord.objects.get(pk=report_id)
is_monitoring_record = True
except MonitoringRecord.DoesNotExist:
...
print("MonitoringRecord.DoesNotExist")

print("is_incident_report", is_incident_report)
print("is_followup_report", is_followup_report)
print("is_subject_record", is_subject_record)
print("is_monitoring_record", is_monitoring_record)

if is_incident_report or is_followup_report:
# check idempotent
Expand Down

0 comments on commit 2772333

Please sign in to comment.