From 41555b6b72ff1c7eb2f5d7aae9b60cb4474bd831 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 2 Dec 2020 08:43:32 -0800 Subject: [PATCH] ZEVA-356: Partial fix (#422) * update to v1.15.0 * Operational Scripts Order (#405) * Added sort to ensure the order of the scripts that get loaded * Removed unnecessary conversion to int * ZEVA-336: Backend changes for calculating insufficient credit. (#406) * Zeva 344 (#408) * Add validation status "Rejected" to the condition to display comment for bceId and gov. * BugFix: Display comment when status is CHANGES_REQUESTED for BCeId user. * fix spacing * Zeva 329: Signing Confirmations (#407) * update to v1.14.0 * Changed upload technique for icbc to do chunk uploads (#381) * update version to be v1.13.0 * ZEVA-304: Credits in the Organizations Table (#363) * Added credits to the organization table. Some minor changes * Removed commented out css * Removed console.log * Updated error codes and highlighting of rows (#364) * ZEVA 192 - credit transfer other supplier accepts/rejects (#366) * refactored button story * set up front end to resemble transfer mockup with comment box and checkboxes * set up backend to post new validation status of transfer to database * added model for comments * added comment table, updated frontend so comments can now be posted * added conditions to render checkboxes, comments, and action bar * fixed styling on table, added condition to only show checkboxes if status is submitted, fixed prop type error for submission * wrote tests for transfer details page * replaced text -government- with Government of B.C. (#367) * added 2021 fixture (#368) * edited save function and form fields so that only credit seller can initiate transfer (#369) * ZEVA 292: Update Roles and Permissions (#370) * Updated roles and permissions * Fixed fixture name conflict * Added back with state saving to the vehicle supplier pages (#373) * ZEVA 307 - add optional company/attorney (#371) * added representative name to database in organization address, added field to form on frontent * styled organization edit form * Added check for the validate and reject functions to show up (#374) * Changed upload technique for icbc to do chunk uploads * Added error catching * Removing the autodelete functionality for now * Increased timeout for gunicorn * More debugging * More debugging * Further increased timeout * Increased timeout to 10 mins * Removing the delete function for now: * Adding loggin * Moving the logging up * Fixed indentation * Changing the test logs * Tried chunking the dataframe * Optimizing the read_csv * reworked the uploader and parser * Moved the save date to before the processing of the spreadsheet * Turning off autocommit for the ingest function * Removing transaction auto commit false * Change to using transaction atomic * Testing without transactions * Set autocommit back. Temporarily put back the icbc date loop * Changed the date creation to get_or_create so it doesnt create too many records * Changed so that insert goes at first, and we just do a get after * Code cleanup * Trying out a higher chunk size for uploading Co-authored-by: Kuan Fan <31664961+kuanfandevops@users.noreply.github.com> Co-authored-by: Emily <44536222+emi-hi@users.noreply.github.com> * Signing Assertion models * Work in progress * Work in progress * Checkbox functions * Should now be saving the confirmations from the users Co-authored-by: Kuan Fan <31664961+kuanfandevops@users.noreply.github.com> Co-authored-by: Emily <44536222+emi-hi@users.noreply.github.com> * Added condition to routes and dashboard entries to hide credit transfers when theyre not enabled (#409) * ZEVA 193 - Director approves transfer (#412) * updated frontend to allow director to validate transfer, added service to add credit transaction records and update balances of each supplier * added new dictionary without years to transfer service for updating balance * fixed supplier summary table to use float instead of string and removed dollar value from amount * fixed conflicts, fixed serializer so non government users see approved by transfer partner instead of recommended * updated date field in sales submission to show submission date if the current status is government-altered ie recommended or checked (#414) * added buyer and seller columns to transfer list table (#415) * ZEVA 339 - Disclaimer text (#416) * added disclaimer to every page for bceid users * changed min height for main * removed extra line * Zeva 348 part 1 (#418) * Index optimization * Fixed an issue where the upload date is missing and the icbc vehicle * Added some indexing as well as temporarily disabled some calls * More scaling down * Restored records count * Restored warnings call * Restoring the count call * Testing out a more simple call for fetching the total credits * Optimizing the call for the total credits * Optimizing the call for the total credits * Changing how the calculation works * Rewrote the get totals function for the list view * Disabling details for now * Changing how the content is being read * Temporarily removing the call to warnings * Get warnings function * Code to look for mismatched vins * Changed logic on how to find invalid vehicle models * More vehicle refactoring * Fixed a bug with the year comparison * Rewriting the check for awarded vins * Different way of finding duplicates * Enabled all the checks * Finishing up the initial rework * Fixing totals * Fixed the summary section * Additional check so front-end doesn't crash * Updated invalid submission detection * Changed the alert so it shows the ineligible rows as opposed to unselected * Restoring some of the old functionality to see if it impacts performance * Removed commented out code * Openshift v4 migration (#404) * Zeva 325: BCEID Organization Administrator (#413) * ZEVA-325: Disable controls if BCeId user editing their own profile and are organization admin. * Add permissions to the role serializer and change conditions from roleCode to permissionCode. * Fixed test fixtures (#419) Co-authored-by: Kuan Fan <31664961+kuanfandevops@users.noreply.github.com> Co-authored-by: NavpreetGrewal <65915811+NavpreetGrewal@users.noreply.github.com> Co-authored-by: Emily <44536222+emi-hi@users.noreply.github.com> --- backend/api/serializers/credit_transfer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/api/serializers/credit_transfer.py b/backend/api/serializers/credit_transfer.py index 8ec935d8d..54a39d3c4 100644 --- a/backend/api/serializers/credit_transfer.py +++ b/backend/api/serializers/credit_transfer.py @@ -208,7 +208,12 @@ def create(self, validated_data): signing_authority_assertion_id=confirmation ) - serializer = CreditTransferSerializer(credit_transfer, read_only=True) + serializer = CreditTransferSerializer( + credit_transfer, read_only=True, + context={ + 'request': request + } + ) return serializer.data