-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* changed position of sbc selection in add exam popup * added location and invigilator select in the non-sbc exams * Invite minimal (#370) * Fix spinner *Fix issues when Database pod goes down * fix quicktrans issue * posting exam with latest body * Phase 3 (#368) * This commit contains working and generally finished (all questions are asked in the right order for the correct process with correct required/minLength/numeric enforecements E&OE). Both the capture Individual and the capture Group workflows are working. For working on wiring to the API. * Added create individual and group exams API calls, and status call to stream files * Clean up directory * Added download and transfer document to BCMP * All changes for SBC Managed, individual pesticide exams * Fix migration file * Test * Fixed bug with exam inventory * Fixed bugs with examinee email and phone * Finished everything for individual exams * Cleanup for everything with group exams Co-authored-by: Scott Rumsby <scott.rumsby@gmail.com> * Update requirements temporarily * changed position of sbc selection in add exam popup * added location and invigilator select in the non-sbc exams * posting exam with latest body * saving group exam - inprogress * group exam posting to bcmp * individual and group exam in the proper format - bcmp services desired format - added group pesticide exam type to bootstrap * ui issues for group exam modal fixed * fixed banner showing after refreshing once exams added * bug fixes for saving non-pesticide exams * modified post exam function to separate bcmp request * emergency fix added click once to check in button * emergency fix added click once to submit button * emergency fix added click once to submit button and added spinners to Submit, Delete and Check-In Functions * emergency fix added click once to submit button, remove spinner logic * emergency fix added click once to buttons on check in modal and add appointment * separated api call for bcmp exam posting * request exam button api integration * Code to put spinner in Appointments, when selecting a service (#376) * Added spinner to let user know not to double click * Added spinner to let user know not to double click Co-authored-by: ozamani <ozamani9@gmail.com> * scheduling for group exam - ui * new parameter added for identifying pesticide exams * Update package-lock.json to fix vulnerabilities * Put in code to handle double clicks, turn on/off spinner * Update the version. * Revert package-lock.json, see if works in IE. * ui changes for add invigilator to group exam modal * add invigilator group exam modal submit * exam download as pdf * download an updated received date exam * Mender update (#379) * Update Raspberry Pi Image * Update with Nightly Reboots * Updates for Raspbian Buster Lite * Update Python libraries * Update web-service script * Update RFKill to unblock wifi * Update WebService * Fix issue with X11 * Clean deps, update launch sequence, fix loading chromium * Update Docker Version of Ubuntu to use new QEMU * Update Mender Artifact Version * More updates for Video Rendering * Fix pkill statement * Fix Server - Sizing issue and Image Display resizing Issue * Update RPI Image with Reboot on Freeze * Additional Changes to accommodate patching * Update Documentation * upload exam api changes * upload exam modal changes * $ sign if exam fee not paid but printed * disable submit for pesticide till job id is generated * offsite invigilators rest added * pesticide offsite invigilators list added * updated minio url expiry to 7 days * email to offsite invigilators after creating exam * return exam if uploaded * Put in logging for debugging session errors * receipt send status in the edit exam modal * awaiting receipt filter * awaiting upload filter * UI for pesticide final step * Use websocket transport for smartboard (#381) * Use websocket transport for smartboard * Make board-socket socket initialization same as Socket.vue code * event id from bcmp job id * exam_type variable issue fixed * db migration for new columns * job id issue fixed * Update requirements.txt * Update exam_bcmp.py * replaced flask-restplus * updated config file * clear data in modal, group exam, hide add shadow invigilator * bug fixes * fixed exam date change issue * bcmp base url to env * non sbc table status correction * await upload filter fix * pest exam date default days corrected * expiry date invalid fix * bcmp to env * bcmp manual job id breaking issue fixed * loading for await upload * exam not ready message persisting issue * filter fix * indication for upload * loading and disable request exam btn * event id editable for pest exams * invigilator id edit fix * updated minio to baseconfig * filter fixes * flask_marshmallow to 0.11.0 Co-authored-by: ozamani9 <ozamani9@gmail.com> Co-authored-by: jhmccoll <32721058+jhmccoll@users.noreply.github.com> Co-authored-by: sjrumsby <sjrumsby@users.noreply.github.com> Co-authored-by: Scott Rumsby <scott.rumsby@gmail.com> Co-authored-by: Karim Gillani <karim.gillani@gov.bc.ca> Co-authored-by: ChrisDMac <33269946+ChrisDMac@users.noreply.github.com> Co-authored-by: Chris <Chris.McIntosh@gov.bc.ca>
- Loading branch information
1 parent
46a0ce7
commit b9ed864
Showing
766 changed files
with
2,554 additions
and
105,715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
'''Copyright 2018 Province of British Columbia | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License.''' | ||
|
||
import logging | ||
import copy | ||
import json | ||
from flask import request, g | ||
from flask_restx import Resource | ||
from app.models.theq import CSR, Office | ||
from app.models.bookings import ExamType, Invigilator | ||
from app.schemas.bookings import ExamSchema, CandidateSchema | ||
from qsystem import api, api_call_with_retry, db, oidc | ||
from app.utilities.bcmp_service import BCMPService | ||
|
||
from app.resources.bookings.exam.exam_post import ExamPost | ||
|
||
@api.route("/exams/bcmp/", methods=["POST"]) | ||
class ExamBcmpPost(Resource): | ||
|
||
exam_schema = ExamSchema() | ||
bcmp_service = BCMPService() | ||
|
||
@oidc.accept_token(require_token=True) | ||
@api_call_with_retry | ||
def post(self): | ||
|
||
csr = CSR.find_by_username(g.oidc_token_info['username']) | ||
|
||
json_data = request.get_json() | ||
|
||
exam, warning = self.exam_schema.load(json_data) | ||
|
||
print("json_data: ") | ||
print(json_data) | ||
|
||
if warning: | ||
logging.warning("WARNING: %s", warning) | ||
return {"message": warning}, 422 | ||
|
||
if not (exam.office_id == csr.office_id or csr.liaison_designate == 1): | ||
return {"The Exam Office ID and CSR Office ID do not match!"}, 403 | ||
|
||
formatted_data = ExamPost.format_data(self, json_data, exam) | ||
exam = formatted_data["exam"] | ||
|
||
invigilator = None | ||
if exam.invigilator_id: | ||
invigilator = Invigilator.query.filter_by(invigilator_id=exam.invigilator_id).first() | ||
|
||
bcmp_response = None | ||
if json_data["ind_or_group"] == "individual": | ||
|
||
exam_fees = json_data["fees"] | ||
|
||
logging.info("Creating individual pesticide exam") | ||
bcmp_response = self.bcmp_service.create_individual_exam(exam, exam_fees, invigilator, formatted_data["pesticide_office"], g.oidc_token_info) | ||
|
||
else: | ||
|
||
logging.info("Creating Group pesticide exam") | ||
bcmp_response = self.bcmp_service.create_group_exam_bcmp(exam, formatted_data["candidates_list_bcmp"], invigilator, formatted_data["pesticide_office"], g.oidc_token_info) | ||
|
||
|
||
if bcmp_response: | ||
return {"bcmp_job_id": bcmp_response['jobId'], | ||
"errors": {}}, 201 | ||
else: | ||
return {"message": "create_group_exam_bcmp failed", | ||
"error": bcmp_response}, 403 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.