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

Remove prescriptionSupplier APIs #1551

Closed
GeekGawd opened this issue Aug 23, 2023 · 2 comments · Fixed by #1755
Closed

Remove prescriptionSupplier APIs #1551

GeekGawd opened this issue Aug 23, 2023 · 2 comments · Fixed by #1755
Assignees

Comments

@GeekGawd
Copy link
Contributor

Describe the bug

  • GET List request on pharmacy/prescription gives 500 error.

To Reproduce
Steps to reproduce the behavior:

  1. Get access token of district admin
  2. Make a get request on /api/v1/pharmacy/prescription

Full Traceback

2023-08-23 17:30:46 [23/Aug/2023 17:30:46] "GET /api/v1/pharmacy/prescription HTTP/1.1" 301 0
2023-08-23 17:30:46 ERROR 2023-08-23 17:30:46,065 log 285 140505878877952 Internal Server Error: /api/v1/pharmacy/prescription/
2023-08-23 17:30:46 Traceback (most recent call last):
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
2023-08-23 17:30:46     response = get_response(request)
2023-08-23 17:30:46                ^^^^^^^^^^^^^^^^^^^^^
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
2023-08-23 17:30:46     response = wrapped_callback(request, *callback_args, **callback_kwargs)
2023-08-23 17:30:46                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/contextlib.py", line 81, in inner
2023-08-23 17:30:46     return func(*args, **kwds)
2023-08-23 17:30:46            ^^^^^^^^^^^^^^^^^^^
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
2023-08-23 17:30:46     return view_func(*args, **kwargs)
2023-08-23 17:30:46            ^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/rest_framework/viewsets.py", line 125, in view
2023-08-23 17:30:46     return self.dispatch(request, *args, **kwargs)
2023-08-23 17:30:46            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
2023-08-23 17:30:46     response = self.handle_exception(exc)
2023-08-23 17:30:46                ^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
2023-08-23 17:30:46     self.raise_uncaught_exception(exc)
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
2023-08-23 17:30:46     raise exc
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 497, in dispatch
2023-08-23 17:30:46     self.initial(request, *args, **kwargs)
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 415, in initial
2023-08-23 17:30:46     self.check_permissions(request)
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/rest_framework/views.py", line 332, in check_permissions
2023-08-23 17:30:46     if not permission.has_permission(request, self):
2023-08-23 17:30:46            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-08-23 17:30:46   File "/usr/local/lib/python3.11/site-packages/dry_rest_permissions/generics.py", line 122, in has_permission
2023-08-23 17:30:46     assert hasattr(model_class, 'has_read_permission'), \
2023-08-23 17:30:46 AssertionError: '<class 'care.facility.models.prescription_supplier.PrescriptionSupplier'>' does not have 'has_read_permission' or 'has_list_permission' defined.

Screenshots

Desktop (please complete the following information):

  • OS: Windows

Additional context

  • Tested on Postman
@gigincg
Copy link
Member

gigincg commented Dec 5, 2023

@vigneshhari Should we purge the prescriptionSupplier APIs? Thoughts?

@vigneshhari
Copy link
Member

Yeah, we can take it out, it serves no purpose now ( To be frank i don't think it ever served any purpose 😅  )

@sainak sainak self-assigned this Dec 7, 2023
@sainak sainak changed the title 500 Internal Server error on endpoint pharmacy/prescription Remove prescriptionSupplier APIs Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants