Skip to content

Commit

Permalink
Feat: Uploader & Error Refactor #166 (#188)
Browse files Browse the repository at this point in the history
* Uploader refactor to just use 1 function for all services.  WIP working state for arc_project_tracking

* New service files

* Moving constants to their own file, changing dictionary to enums, seperating import function into function steps, updating logic to support new data formats, added a couple helper functions

* Cleaning up logic, adding working upload state for data fleets & charger rebates

* Working state for all uploader services refactored to use general import function

* Fixing field type mapping and adding type casts & error exceptions for field types

* Individual cell error handling with response message formatting and code cleanup

* Making uploaded data store the idir of who uploaded it & updating suvi model

* Updating README with instructions for creating a user account locally.

* Excluding a list of datasets so they can be re-implemented as we get updated models for them

* Moving dataset config to constants, updating constants import to avoid namespace clashing, updated how alerts are displayed to use existing functionality
  • Loading branch information
JulianForeman authored Mar 28, 2024
1 parent 4bb115f commit 73813fc
Show file tree
Hide file tree
Showing 20 changed files with 1,046 additions and 812 deletions.
13 changes: 12 additions & 1 deletion django/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,15 @@ use the same as above to load fixtures
docker-compose exec api bash
python manage.py loaddata api/fixtures/0001_add_ldv_rebates_datasets.json

etc
etc

## Creating User Account
After running all the fixtures to create the dataset dropdown list and the user_permissions table.
You will need to run a few SQL commands to allow your account to upload documents locally.

insert into public.user (create_user, idir) values ('test', 'IDIR');
insert into user_permission (create_user, permission_id, user_id) values ('test', 1, 1);
insert into user_permission (create_user, permission_id, user_id) values ('test', 2, 1);

Only after running these will you be able to upload into CTHUB locally.
If you're encountering errors make sure you've run the fixture for creating the user_permission table and that you're not missing any fields in SQL.
Loading

0 comments on commit 73813fc

Please sign in to comment.