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

python manage.py summarize is not working #911

Closed
mathew-alex opened this issue Jul 4, 2022 · 5 comments · Fixed by #841
Closed

python manage.py summarize is not working #911

mathew-alex opened this issue Jul 4, 2022 · 5 comments · Fixed by #841

Comments

@mathew-alex
Copy link
Contributor

Traceback (most recent call last):
File "/app/manage.py", line 55, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.10/site-packages/django/core/management/init.py", line 381, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.10/site-packages/django/core/management/init.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/app/care/facility/management/commands/summarize.py", line 21, in handle
PatientSummary()
File "/app/care/facility/summarisation/patient_summary.py", line 77, in PatientSummary
count = patients.filter(**filter).count()
File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 892, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/django/db/models/query.py", line 910, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1290, in add_q
clause, _ = self._add_q(q_object, self.used_aliases)
File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1315, in _add_q
child_clause, needed_inner = self.build_filter(
File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1251, in build_filter
condition = self.build_lookup(lookups, col, value)
File "/usr/local/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1107, in build_lookup
raise FieldError('Related Field got invalid lookup: {}'.format(lookup_name))
django.core.exceptions.FieldError: Related Field got invalid lookup: admitted_to

@Ashesh3
Copy link
Member

Ashesh3 commented Jul 5, 2022

Seems related to #841

The line causing the error is to be removed since admitted_to is no longer needed.

https://github.com/coronasafe/care/pull/841/files#diff-1cfa8525a1bda136e828a93f18708d7aca15e41111ac3e0fbc9fc848a9a7a116L98

@skks1212
Copy link
Member

skks1212 commented Jul 6, 2022

@Ashesh3 please link this issue with your PR so it is closed on merge

@Ashesh3
Copy link
Member

Ashesh3 commented Jul 6, 2022

@skks1212 added, ty :D

@vigneshhari
Copy link
Member

@mathew-alex close if the issue has been resolved.

@sainak
Copy link
Member

sainak commented May 24, 2023

resolved in #924

@sainak sainak closed this as completed May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants