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

add check for contractItemID validity to prevent 500 #14435

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

Conversation

usamabinnadeem-10
Copy link
Contributor

@usamabinnadeem-10 usamabinnadeem-10 commented Oct 18, 2024

Done

  • Add a check for contractItemID query parameter when scheduling an exam to prevent 500 error

QA

  • Check out this feature branch
  • Run the site using the command ./run serve or dotrun
  • View the site locally in your web browser at: http://0.0.0.0:8001/
    • Be sure to test on mobile, tablet and desktop screen sizes
  • Purchase and schedule an exam and it should go through

Issue / Card

Fixes WD-16047

Help

QA steps - Commit guidelines

@webteam-app
Copy link

@abhigyanghosh30
Copy link
Contributor

This is not relevant to the error btw

@abhigyanghosh30
Copy link
Contributor

@usamabinnadeem-10
Copy link
Contributor Author

@abhigyanghosh30 the error is related to the contractItemID being an empty string. Previously the id was being read from the form but now I am extracting that directly from the query and if it is not present we show an error and don't schedule the exam in that scenario.

@anthonydillon
Copy link
Contributor

@abhigyanghosh30 can you reply to the last comment please?

@abhigyanghosh30
Copy link
Contributor

Added comment in the PR review. It has not been addressed yet

@@ -268,7 +268,7 @@ def cred_schedule(
f"{data['date']}T{data['time']}", "%Y-%m-%dT%H:%M"
)
starts_at = tz_info.localize(scheduled_time)
contract_item_id = data["contract_item_id"]
contract_item_id = flask.request.args.get("contractItemID")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not be used to get data from POST requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants