-
Notifications
You must be signed in to change notification settings - Fork 0
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-bug07-phase2 #135
base: develop
Are you sure you want to change the base?
Fix-bug07-phase2 #135
Conversation
MonishaSivanathan
commented
Jan 6, 2025
- changed the constant value take_test_at to service_location
- raised an exception while updating the master lab result
controller/master_controller.py
Outdated
@@ -313,6 +313,11 @@ def fetch_data(table_name: str, coding: MasterModel): | |||
def update_master_data(table_name: str, resource_id: str, data: CreateMasterModel): | |||
if table_name not in MasterClient.table: | |||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=f"Kindly, verify the name.") | |||
if data.code and table_name == "lab_test": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried to update any other value with the same existing code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but @tamsud what they asked is if they give the cose 2nd time i have to raise exception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the same code if i try to update the other field what would happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it wont update it will raise exception tamil, can you help me what to do in this scenario
@@ -48,7 +48,7 @@ def create_master_entries(table_name: str, data: CreateMasterModel): | |||
code_values = MasterClient.get_by_code(MasterClient.table[table_name], data.code) | |||
code_entry = code_values.get("entry", []) | |||
if code_entry: | |||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f"Code already exists for {table_name}.") | |||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=f"Code already exists, Please use a unique code") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not make this king of error again, or you copy pasting it from some other function.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have copied from the create function tamil
3ff8da2
to
a753d60
Compare
- changed the constant value take_test_at to service_location - raised an exception while updating the master lab result
a753d60
to
9667332
Compare