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

[FIX] spp_api: Override the handle_error function #672

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from

Conversation

emjay0921
Copy link
Contributor

@emjay0921 emjay0921 commented Nov 21, 2024

Why is this change needed?

To fix the spp_api initialization error.

How was the change implemented?

Added and overridden the function handle_error since not overriding this is the cause of the api not initializing properly.

New unit tests

None

Unit tests executed by the author

None

How to test manually

In Odoo:

  • Install or Upgrade spp_api.
  • Install spp_api_records.
  • Activate Developer Mode.
  • Navigate to Users and Find your User Account.
  • In Allowed APIs tab check if spp_api is in the list.
  • Click the Key Icon in the right side of OpenAPI Token.
  • A pop-up will open, click the Copy. (Paste this on a notepad this is important, this is the bearer token.)

In Postman: (Download this postman collection:
OpenSPP-ACF API.postman_collection.json)

  • Open the postman.
  • Import the postman collection.
  • Click the created collection from the import (OpenSPP-ACF API).
  • Go to Variables.
  • In (Current Value) user_prog_token and user_reg_token replace the value after 'Bearer' with the bearer token you copied before. (Make sure the word Bearer and a blank space is still there before the bearer token you pasted.).
    e.g Bearer ey........
  • In (Current Value) api_url change the url but make sure the /api/spp_api/1/ is still in the correct place.
  • Then click on Get the list of programs or anything from the list then click Send.

Notes

I'm not sure how or if we can test this with runboat as a private_key.pem and public_key.pub is needed to be stored inside the container's /etc/secrets/ folder.

Related links

#603

@emjay0921 emjay0921 linked an issue Nov 21, 2024 that may be closed by this pull request
3 tasks
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 42.10526% with 11 lines in your changes missing coverage. Please review.

Project coverage is 72.56%. Comparing base (26fe80a) to head (979e4f3).
Report is 28 commits behind head on 17.0.

Files with missing lines Patch % Lines
spp_api/controllers/apijsonrequest.py 42.10% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             17.0     #672      +/-   ##
==========================================
- Coverage   72.74%   72.56%   -0.19%     
==========================================
  Files         618      664      +46     
  Lines       16455    17239     +784     
  Branches     2116     2194      +78     
==========================================
+ Hits        11971    12509     +538     
- Misses       4097     4335     +238     
- Partials      387      395       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@emjay0921 emjay0921 marked this pull request as ready for review November 21, 2024 11:15
Copy link
Member

@gonzalesedwin1123 gonzalesedwin1123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the codecov errors

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 this pull request may close these issues.

Fix the migration issues of the SPP API module
2 participants