Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when generic or company is none #1451

Closed
sainak opened this issue Jul 14, 2023 · 1 comment · Fixed by #1452
Closed

TypeError when generic or company is none #1451

sainak opened this issue Jul 14, 2023 · 1 comment · Fixed by #1452
Assignees
Labels
bug Something isn't working

Comments

@sainak
Copy link
Member

sainak commented Jul 14, 2023

Sentry Issue: CARE-QY

TypeError: 'Prescription' object is not subscriptable
  File "django/template/base.py", line 880, in _resolve_lookup
    current = current[bit]

TypeError: sequence item 1: expected str instance, NoneType found
(22 additional frame(s) were not displayed)
...
  File "care/facility/tasks/discharge_report.py", line 21, in generate_and_upload_discharge_summary_task
    file_db_entry = generate_and_upload_discharge_summary(consultation_id)
  File "care/facility/utils/reports/discharge_report.py", line 106, in generate_and_upload_discharge_summary
    generate_discharge_summary_pdf(data, file)
  File "care/facility/utils/reports/discharge_report.py", line 77, in generate_discharge_summary_pdf
    html_string = render_to_string("reports/patient_pdf_report.html", data)
  File "care/facility/models/prescription.py", line 139, in medicine_name
    return str(self.medicine) if self.medicine else self.medicine_old
  File "care/facility/models/prescription.py", line 67, in __str__
    return " - ".join([self.name, self.generic, self.company])
@sentry-io
Copy link

sentry-io bot commented Jul 14, 2023

Sentry issue: CARE-QY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants