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

V2.0.5prod #604

Merged
merged 694 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
694 commits
Select commit Hold shift + click to select a range
8215f7c
Fixed the bug in the template_manage.html file
RickWangPerth Sep 13, 2024
0008d76
Merge branch 'v2.5dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 13, 2024
15a3e44
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
dc9a936
Fixed a bug in the template_manage.html file that caused the template…
RickWangPerth Sep 13, 2024
4d845ab
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
369bdc3
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
436f543
Fixed the bug in the template_manage.html file
RickWangPerth Sep 13, 2024
872eede
Merge branch 'v2.5dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 13, 2024
abec308
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
ba091ae
Merge branch 'v2.5dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 13, 2024
50afd2d
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
ae0f561
Fixed the bug in the template_manage.html file
RickWangPerth Sep 13, 2024
936c1f3
Merge branch 'v2.5dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 13, 2024
d0d1e00
Fixed a bug in the template_manage.html file that caused the template…
RickWangPerth Sep 13, 2024
0a731bc
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
855a4bb
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
80c3014
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
c57bd6e
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
84b9abe
Update template_manage.html
RickWangPerth Sep 13, 2024
92284c3
Update views.py
RickWangPerth Sep 13, 2024
831cb97
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
836d6e4
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
b0e3a60
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
cf78a2c
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
633b798
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
e9e2f1e
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
ab5ef8c
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
230d3a5
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
64df1a8
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
93aeee5
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
d0afbd2
Fixed bug in error message in template manage page
RickWangPerth Sep 13, 2024
20aabe7
Refind the placement in batch curation page
RickWangPerth Sep 13, 2024
b65b8c5
Refind the placement in batch curation page
RickWangPerth Sep 13, 2024
add6808
Refind the placement in batch curation page
RickWangPerth Sep 13, 2024
f0af6df
Change batch code validation to bootstrap style
RickWangPerth Sep 13, 2024
6fbc0a1
Change batch code validation to bootstrap style
RickWangPerth Sep 13, 2024
9ee06fa
Change batch code validation to bootstrap style
RickWangPerth Sep 13, 2024
d9abf86
Show last 10 batch in batch curation page
RickWangPerth Sep 13, 2024
b89bf56
Show last 10 batch in batch curation page
RickWangPerth Sep 13, 2024
871f926
Fixed bug in add batches code page
RickWangPerth Sep 13, 2024
ea01742
Fixed bug in add batches code page
RickWangPerth Sep 13, 2024
9b133f2
Fixed bug in add batches code page
RickWangPerth Sep 13, 2024
bfe6739
Added Btach id to breadcrumbs in add batches page
RickWangPerth Sep 13, 2024
d679763
Merge branch 'v2.5dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 13, 2024
3d046da
Merge branch 'v2.5dev' into v2.5uat
RickWangPerth Sep 13, 2024
4994b37
Damage code can be select for related body part in data entry page
RickWangPerth Sep 13, 2024
78bc3a6
Merge branch 'v2.5dev' into v2.5uat
RickWangPerth Sep 13, 2024
4fa411b
Damage code can be select for related body part in data entry page
RickWangPerth Sep 13, 2024
d1a0016
Merge branch 'v2.5dev' into v2.5uat
RickWangPerth Sep 13, 2024
ae60b0e
Merge remote-tracking branch 'upstream/master' into v2.5dev
RickWangPerth Sep 14, 2024
1bb7f57
Fixed type error in view
RickWangPerth Sep 14, 2024
44e4def
Merge branch 'v2.5dev' into v2.5uat
RickWangPerth Sep 16, 2024
9e5f138
Merge branch 'v2.5uat' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 16, 2024
668c61b
Merge branch 'v2.5uat' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 16, 2024
bebbf01
Merge branch 'v2.5dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 16, 2024
74743d9
Adjsut btns layout in create new entry page
RickWangPerth Sep 16, 2024
fd9d780
Merge branch 'v2.5dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 16, 2024
a283f2e
Merge branch 'v2.5dev' into v2.5uat
RickWangPerth Sep 16, 2024
ea1ccee
Added django debug toolbar package
RickWangPerth Sep 16, 2024
040be53
Fixed url for careate new entry in home page
RickWangPerth Sep 16, 2024
56a3a67
Merge branch 'v2.5dev' into v2.5uat
RickWangPerth Sep 16, 2024
36308de
Adjsut pages layout to container-fluid mt-5
RickWangPerth Sep 16, 2024
a1f4275
Adjust pages create new entry and batches curation page layout
RickWangPerth Sep 16, 2024
b0e3d90
Merge branch 'v2.5dev' into v2.5uat
RickWangPerth Sep 16, 2024
096d030
Please update the following options in `pyproject.toml`:
RickWangPerth Sep 16, 2024
6d70ff6
Merge branch 'v2.5uat' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 16, 2024
edf175b
Update the following options in `pyproject.toml`:
RickWangPerth Sep 16, 2024
5b28d7a
Adjust create new entry page message
RickWangPerth Sep 16, 2024
0e9c2ef
Adjust create new entry page message
RickWangPerth Sep 16, 2024
0fa0ae5
Add sex speies status filter in exprot form page
RickWangPerth Sep 16, 2024
b71f100
Fix the url in homepage
RickWangPerth Sep 17, 2024
6c8e5a5
Merge branch 'v2.6dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 17, 2024
8c53fba
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 17, 2024
b4f08c2
Fix bug in search invalid tag id in find turtle view
RickWangPerth Sep 17, 2024
cbe9cb6
Adjust pages layout
RickWangPerth Sep 17, 2024
e42f987
Fixed body part bug in data entry page
RickWangPerth Sep 17, 2024
abe4708
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 17, 2024
da385e4
Merge branch 'v2.6uat' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 17, 2024
f2b4045
Fixed form submisstion bug in data entry page
RickWangPerth Sep 17, 2024
7a8dbb7
Test the damages function
RickWangPerth Sep 17, 2024
23ce28d
Fix bug in data entry form
RickWangPerth Sep 17, 2024
cc8da91
Merge branch 'v2.6dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 17, 2024
704d43a
Added damage code filter
RickWangPerth Sep 17, 2024
11cfd59
Fix damage code bug
RickWangPerth Sep 17, 2024
7a262ec
Remove auto fill enter feature and fix body part bug in data entry fo…
RickWangPerth Sep 17, 2024
4e9429a
Fix succes url in data entry form view
RickWangPerth Sep 17, 2024
edeb88b
Merge branch 'v2.6dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 17, 2024
53f39c4
Apply pagination to the batches_curation page
RickWangPerth Sep 17, 2024
8c87983
Fix typo in data entry form
RickWangPerth Sep 17, 2024
e7010d9
Remove auto fill enter feature in data entry form page
RickWangPerth Sep 17, 2024
db8496d
Merge branch 'v2.6dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 17, 2024
c485f01
Remove auto fill enter feature
RickWangPerth Sep 18, 2024
ae3879a
Use Entered by Charfield for name input in data entry page
RickWangPerth Sep 18, 2024
fed4fd3
Add style to enterer name field in data entry form page
RickWangPerth Sep 18, 2024
136888e
Add successful feedback message in find turtle page
RickWangPerth Sep 18, 2024
2b557f9
Adjust find turtle page style
RickWangPerth Sep 18, 2024
2a6064d
Add warning and error messages
RickWangPerth Sep 18, 2024
ab5cbb8
Add warning and error messages
RickWangPerth Sep 18, 2024
46fa436
Removed redundant message from find turtle page
RickWangPerth Sep 18, 2024
8d2b064
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 18, 2024
c2eef04
Merge branch 'v2.6uat' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 18, 2024
2f900e7
Add entry count and flagged count in batches curation page
RickWangPerth Sep 18, 2024
556a2a9
Merge branch 'v2.6dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 18, 2024
7d0bdae
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 18, 2024
dbd6bb4
Add redbg to Flagged row in batches curation page
RickWangPerth Sep 18, 2024
95b9546
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 18, 2024
2354fd2
Add Lay info into batch detail
RickWangPerth Sep 18, 2024
4c38103
Make sex species optional for template_manage
RickWangPerth Sep 18, 2024
e2ff97f
Change the Btaches curation page name to Batches Mangement
RickWangPerth Sep 18, 2024
c72738c
Add species checkbox in summary
RickWangPerth Sep 18, 2024
96c5706
Force the date format to dd/mm/yy & make night and expected data opti…
RickWangPerth Sep 18, 2024
0a2d81c
Add new permission rule
RickWangPerth Sep 19, 2024
15571d8
Make flagged row style important
RickWangPerth Sep 19, 2024
733480d
Merge branch 'v2.6dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 19, 2024
72a4e5b
Add 'add person' btn in batch curation page
RickWangPerth Sep 19, 2024
a7d231d
Add superuser, staff and team leader can add person from batch detail…
RickWangPerth Sep 19, 2024
e7f0ac4
Fix damage code bug and add auto fill feature when no injury in data …
RickWangPerth Sep 19, 2024
d2c18f8
Make night optional for batch code generator in add batch page
RickWangPerth Sep 19, 2024
88bfbe3
Add Team Leader Name to quick add batch feature
RickWangPerth Sep 19, 2024
1b4b116
Merge branch 'v2.6dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 19, 2024
38e2663
Add group filter
RickWangPerth Sep 19, 2024
ea92739
Adjust Batch Person Function
RickWangPerth Sep 19, 2024
83e2764
Adjust Add person btn in batch curation page
RickWangPerth Sep 19, 2024
19f2b18
Tidy scripts in batches curation and create new entry page
RickWangPerth Sep 19, 2024
1f0e8d3
Add admin url to batches curation page
RickWangPerth Sep 19, 2024
ab388c3
Fixed data picker bug in batches curation page
RickWangPerth Sep 19, 2024
178c6cf
Fix search person issue
RickWangPerth Sep 19, 2024
217773c
Fix search person issue
RickWangPerth Sep 19, 2024
fa77691
Update search person style
RickWangPerth Sep 19, 2024
9482793
Fix search person issue
RickWangPerth Sep 19, 2024
b60c09c
Fix search person issue
RickWangPerth Sep 19, 2024
300cf10
Adjust night No
RickWangPerth Sep 19, 2024
9ad6eb3
Fix bug in data entry form
RickWangPerth Sep 19, 2024
ed46246
Add auto select do not process when new turtle with didntcheck Tag
RickWangPerth Sep 19, 2024
10c8e46
Update bg color when donotprocess checked
RickWangPerth Sep 19, 2024
d6acbbd
Add loading overlay and spinner to add batch code page
RickWangPerth Sep 19, 2024
55c9f91
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 19, 2024
6b7ff7a
Change the Create a new entry btn
RickWangPerth Sep 19, 2024
81d7c9b
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 19, 2024
a6518ae
Merge branch 'v2.6uat' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 19, 2024
7193c44
Re design export form
RickWangPerth Sep 19, 2024
6203d71
Only superuser can staff can delete entry
RickWangPerth Sep 19, 2024
c121483
Edit the person search style
RickWangPerth Sep 19, 2024
7e440af
Fix bug in export find species
RickWangPerth Sep 19, 2024
f042df7
Fix bug in export find species
RickWangPerth Sep 19, 2024
8d7fe04
Fix bug in export find species and place name
RickWangPerth Sep 19, 2024
61841cb
Fix bug in export find place name
RickWangPerth Sep 19, 2024
b34f2c5
Use email as PK for person import
RickWangPerth Sep 20, 2024
3c7de32
Use email as PK for person import
RickWangPerth Sep 20, 2024
510007c
Fill false to RECORDER column in PERSON Table
RickWangPerth Sep 20, 2024
46220dd
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 20, 2024
dc673e0
Adjust layout in batch detail page
RickWangPerth Sep 20, 2024
7230abe
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 20, 2024
6618bb3
Add permission control to navbar
RickWangPerth Sep 20, 2024
b0ef34e
Modify the summary layout in data entry form
RickWangPerth Sep 20, 2024
2b5c62e
Modify the summary layout in data entry form
RickWangPerth Sep 20, 2024
83ab25b
Fix the reflash problem when form submit in data entry page
RickWangPerth Sep 20, 2024
2546efd
Remove unused scrip drom batches curation page
RickWangPerth Sep 20, 2024
e1e1c0f
Adjust data entry form layout
RickWangPerth Sep 20, 2024
c3b5d5b
Fix bug with loading spinner in add batches code page
RickWangPerth Sep 20, 2024
9f1fb4e
Adjust summary layout in data entry form
RickWangPerth Sep 20, 2024
586aa9d
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 20, 2024
e2e6b78
Fix team leader name issue
RickWangPerth Sep 20, 2024
e5279e0
Fix team leader name issue
RickWangPerth Sep 20, 2024
e39b201
Add spinner to save btn in add batches code page
RickWangPerth Sep 20, 2024
5141f7a
Fix datepicker bug in data curetion page
RickWangPerth Sep 20, 2024
e2a2819
Fix get full name bug for team laeder name
RickWangPerth Sep 20, 2024
000a655
Fix team leader and tempalte name
RickWangPerth Sep 20, 2024
959c260
Use flatpicker
RickWangPerth Sep 20, 2024
2f7eaba
Fix Team leader Id bug in batches curation page
RickWangPerth Sep 24, 2024
62c2452
Fix Template save issue
RickWangPerth Sep 24, 2024
509cdd8
Fix Team leader Id bug in batches curation page
RickWangPerth Sep 24, 2024
d339a43
Fix Team leader Id bug in batches curation page
RickWangPerth Sep 24, 2024
c09dff4
Fix Team leader Id bug in batches curation page
RickWangPerth Sep 24, 2024
3a03c8f
Fix Team leader Id bug in batches curation page
RickWangPerth Sep 24, 2024
aa0a20f
Fix template save issue
RickWangPerth Sep 24, 2024
ecef861
Fixing template issue
RickWangPerth Sep 24, 2024
e1eab9f
Fix template save issue
RickWangPerth Sep 24, 2024
190293b
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 24, 2024
60eb842
Merge branch 'v2.6uat' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 24, 2024
2592044
Fix template, team leader name and lay issues
RickWangPerth Sep 24, 2024
e176b19
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 24, 2024
450223b
Generate template name without sex ans species
RickWangPerth Sep 24, 2024
c4014a1
Fix typo and lay issue
RickWangPerth Sep 24, 2024
93b8556
Fix lay issue in batch detail page
RickWangPerth Sep 24, 2024
93d383a
Adjust species check layout
RickWangPerth Sep 24, 2024
26bcbef
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 24, 2024
94091a8
Can save template only have location and place
RickWangPerth Sep 24, 2024
451cbd4
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 24, 2024
18962f1
Adjust message display in template manage page
RickWangPerth Sep 24, 2024
77e71ba
Adjust exist template display layout with none sex/species
RickWangPerth Sep 24, 2024
7369b02
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 24, 2024
7a11409
Use web version validation process in SQL server
RickWangPerth Sep 24, 2024
ff6d630
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 24, 2024
38e7a9f
Fix Measurement/ Damange/Invalid submission issue in data entry form …
RickWangPerth Sep 25, 2024
10f1037
Fix Measurement/ Damange/Invalid submission issue in data entry form …
RickWangPerth Sep 25, 2024
2d4ab04
Fix add person page
RickWangPerth Sep 25, 2024
63bbdf8
Fix add person issues
RickWangPerth Sep 25, 2024
08dfa45
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 25, 2024
dac89d8
No Change for do_not_process when tag is valid
RickWangPerth Sep 25, 2024
5d1f830
Hide old flipper tag when no selected
RickWangPerth Sep 25, 2024
3d383a8
Make location and place optional for the template
RickWangPerth Sep 25, 2024
186a209
Reorder the Location
RickWangPerth Sep 25, 2024
f969d12
Change Template model to accept null location and place
RickWangPerth Sep 25, 2024
aae1fd2
Change layout in create new entry and batches curation pages
RickWangPerth Sep 25, 2024
2afd533
Add tag toggle feature to pit tag and scar
RickWangPerth Sep 25, 2024
38263a8
Reduce the selection fot tag state
RickWangPerth Sep 25, 2024
79a0a64
Adjust data entry form layout
RickWangPerth Sep 25, 2024
024ad97
Adjust data entry form layout
RickWangPerth Sep 25, 2024
34d9703
Adjust data entry form layout
RickWangPerth Sep 25, 2024
c5529a9
Adjust data entry form layout
RickWangPerth Sep 25, 2024
8e4fa56
Adjust data entry form layout
RickWangPerth Sep 25, 2024
b73ccd2
Adjust error msg in data entry table
RickWangPerth Sep 25, 2024
3ebf56a
Store name info with data entry page
RickWangPerth Sep 25, 2024
b59756d
Merge branch 'v2.6dev' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 25, 2024
e650930
Adjust data entry form layout
RickWangPerth Sep 25, 2024
875134a
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 25, 2024
6a1a5c3
Adjust batch curation page layout: add template column
RickWangPerth Sep 26, 2024
ab14a1e
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 26, 2024
b9b6001
Merge branches 'v2.6uat' and 'v2.6uat' of https://github.com/RickWang…
RickWangPerth Sep 26, 2024
e78b9f1
Adjust batch curation and create new entry layout
RickWangPerth Sep 26, 2024
a9861eb
Adjust batch and entry layout
RickWangPerth Sep 26, 2024
ab28618
Change the batches curation name in nav bar
RickWangPerth Sep 26, 2024
ef34465
Change the batches curation name in nav bar
RickWangPerth Sep 26, 2024
dfb2006
Change the batches curation name in nav bar
RickWangPerth Sep 26, 2024
3185418
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 26, 2024
633043a
Add minus to latitude in summary
RickWangPerth Sep 26, 2024
1c8ea56
Add integer validator to curved_carapace_length_notch and curved_cara…
RickWangPerth Sep 26, 2024
f83dad9
Add integer validation and minus to latitude
RickWangPerth Sep 26, 2024
beae9b9
Fix bugs in years from create batches
RickWangPerth Sep 26, 2024
bf8d07e
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 26, 2024
a7060e0
Check unprocessed new tag in old tag validation in data entry page
RickWangPerth Sep 26, 2024
08a2b81
Check unprocessed new tag for old tag validation
RickWangPerth Sep 26, 2024
d27f619
Make Find turtle can find tag in pervious unprocessed tag
RickWangPerth Sep 26, 2024
3af93d7
Make Find turtle can find tag in pervious unprocessed tag
RickWangPerth Sep 26, 2024
00e877d
Fix injury handler issues
RickWangPerth Sep 26, 2024
5f2a920
Fix measurement handler issue
RickWangPerth Sep 26, 2024
e88cb67
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 26, 2024
351873d
Fix location display issue in data entry form and observation page
RickWangPerth Sep 27, 2024
67aff51
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 27, 2024
e659ccc
Merge branch 'v2.6uat' of https://github.com/RickWangPerth/wastd into…
RickWangPerth Sep 27, 2024
b74be8e
Merge branch 'v2.6uat' of v2.6dev -- wamtram2/views.py
RickWangPerth Sep 27, 2024
50301d0
Change the table name/info to fit with PROD
RickWangPerth Sep 27, 2024
a56d920
Fit table info with PROD db
RickWangPerth Sep 27, 2024
4892bb9
Fix some typo in pages
RickWangPerth Sep 27, 2024
2d43b2a
Merge branch 'v2.6dev' into v2.6uat
RickWangPerth Sep 27, 2024
4ca1007
Remove the log from application
RickWangPerth Sep 27, 2024
22706bb
Update dependencies and bump version to 2.0.5
RickWangPerth Sep 27, 2024
cdf4fa4
Update test_management_commands_auto_qa_checks.py
RickWangPerth Sep 27, 2024
acae059
Fix error in observation test cases
RickWangPerth Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sh text eol=lf
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"master"
]
}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# syntax=docker/dockerfile:1
# Prepare the base environment.
FROM python:3.11.8-slim as builder_base_wastd

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Docker image

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
# NOTE: we're constrained to using the version(s) of Debian which the Microsoft ODBC driver supports.
MAINTAINER asi@dbca.wa.gov.au

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Docker image

The MAINTAINER instruction is deprecated, use a label instead to define an image author

MaintainerDeprecated: Maintainer instruction is deprecated in favor of using label More info: https://docs.docker.com/go/dockerfile/rule/maintainer-deprecated/
LABEL org.opencontainers.image.source https://github.com/dbca-wa/wastd

Check warning on line 6 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Docker image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "LABEL key=value" should be used instead of legacy "LABEL key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

RUN apt-get update -y \
&& apt-get upgrade -y \
Expand All @@ -23,7 +23,7 @@
&& rm -rf /var/lib/apt/lists

# Install Python libs using Poetry.
FROM builder_base_wastd as python_libs_wastd

Check warning on line 26 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Docker image

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
WORKDIR /app
ENV POETRY_VERSION=1.7.1
RUN pip install poetry=="${POETRY_VERSION}"
Expand All @@ -49,4 +49,4 @@

USER ${UID}
EXPOSE 8080
CMD ["gunicorn", "wastd.wsgi", "--config", "gunicorn.py"]
CMD ["gunicorn", "wastd.wsgi", "--config", "gunicorn.py"]
2 changes: 1 addition & 1 deletion kustomize/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ patches:
- path: service_patch.yaml
images:
- name: ghcr.io/dbca-wa/wastd
newTag: 2.0.4
newTag: 2.0.5
10 changes: 5 additions & 5 deletions observations/management/commands/automated_qa_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
)
from users.models import User


class Command(BaseCommand):
help = 'Runs automated QA/QC checks to flag records for manual curation as needed'

def handle(self, *args, **options):
logger = logging.getLogger('turtles')
logger.info('Running automated QA/QC checks and flagging records for curation')

system_user = User.objects.get(pk=1)
unknown_user = User.objects.get_or_create(name='Unknown user', username='unknown_user')[0]

Expand All @@ -44,7 +44,7 @@ def handle(self, *args, **options):
enc.flag(by=system_user, description='Flagged for curation by automated checks due to site containing "testing"')
enc.save()

# Check: Any turtle nest encounter with uncertain species.cg
# Check: Any turtle nest encounter with uncertain species.
nest_encounters = TurtleNestEncounter.objects.filter(species=TURTLE_SPECIES_DEFAULT, status=Encounter.STATUS_IMPORTED)
if nest_encounters:
logger.info(f'Flagging {nest_encounters.count()} turtle nest encounters for curation due to uncertain species')
Expand Down Expand Up @@ -96,7 +96,7 @@ def handle(self, *args, **options):

# Check: Any records with the following species at any of the following areas.
# Species: Leatherback, Loggerhead, Olive Ridley
# Areas: Delambre Island, Thevenard Island, Port Hedland, Rosemary Island, Eco Beach, Barrow Island, Mundabullungana
# Areas: Delambre Island, Thevenard Island, Port Hedland, Rosemary Island, Eco Beach, Barrow Island, Mundabullangana
localities = [
"Delambre Island",
"Thevenard Island",
Expand Down Expand Up @@ -188,7 +188,7 @@ def handle(self, *args, **options):
# Check: imported Turtle Nest Encounters with 'Unknown user' as the reporter.
nest_encounters = TurtleNestEncounter.objects.filter(status=Encounter.STATUS_IMPORTED, reporter=unknown_user)
if nest_encounters:
logger.info(f'Flagging {nest_encounters.count()} turtle nest encounters for curation: unknown reporter')
logger.info(f'Flagging {nest_encounters.count()} turtle nest encounters for curation due to unknown reporter')
for enc in nest_encounters:
enc.flag(by=system_user, description='Flagged for curation by automated checks due to unknown reporter')
enc.save()
Expand All @@ -204,7 +204,7 @@ def handle(self, *args, **options):
# Check: imported Animal Encounters with 'Unknown user' as the reporter.
animal_encounters = AnimalEncounter.objects.filter(status=Encounter.STATUS_IMPORTED, reporter=unknown_user)
if animal_encounters:
logger.info(f'Flagging {animal_encounters.count()} animal encounters for curation: unknown reporter')
logger.info(f'Flagging {animal_encounters.count()} animal encounters for curation due to unknown reporter')
for enc in animal_encounters:
enc.flag(by=system_user, description='Flagged for curation by automated checks due to unknown reporter')
enc.save()
Expand Down
315 changes: 315 additions & 0 deletions observations/tests/test_management_commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,315 @@
from django.core.management import call_command
from django.test import TestCase
from unittest.mock import patch, MagicMock
from observations.models import TurtleNestEncounter, TurtleNestDisturbanceObservation, TurtleNestDisturbanceTallyObservation, AnimalEncounter, Area, User, Encounter
from observations.lookups import TURTLE_SPECIES_DEFAULT, NEST_TYPE_TRACK_UNSURE, NEST_AGE_DEFAULT
from django.contrib.gis.geos import Polygon, Point
from datetime import datetime
import pytz
import uuid

"""
Unit Test Suite for Automated QA Checks Management Command

This test suite is designed to validate the functionality of the `automated_qa_checks`
management command in the `observations` application. The command performs various
automated QA checks on turtle nest encounters and flags records for manual curation
based on different criteria.

Tests include:
1. Flagging turtle nest encounters with site labels containing specific terms
(e.g., "training", "testing").
2. Flagging turtle nest encounters with uncertain species, nesting outcomes, nest ages,
and predation.
3. Flagging turtle nest encounters using test species.
4. Flagging turtle nest encounters and animal encounters reported by an unknown user.
5. Marking all imported turtle nest encounters as curated if they pass all QA checks.
6. Flagging turtle nest encounters with specific species in specific areas,
including Ningaloo and other specified localities.
7. Validating the command's behavior with multiple records (test_flag_multiple_nests_with_training_in_site_name).

Each test uses the `unittest.mock` library to patch the logging mechanism, ensuring
that the command logs the expected messages. The tests create necessary data in the
database, execute the command, and then verify that the correct log messages are
produced, indicating that the appropriate records were flagged or marked as curated.
"""


TEST_SPECIES = 'test-turtle'
TURTLE_SPECIES = 'chelonia-mydas'
NEST_AGE = 'fresh'
NEST_TYPE = 'nest'
LOCALITY = 'Port Hedland'
TURTLE_SPECIFIC_SPECIES = "dermochelys-coriacea" # Leatherback turtle

class AutomatedQAChecksCommandTests(TestCase):
def setUp(self):
self.system_user = User.objects.create(pk=1, username='system_user')
self.unknown_user = User.objects.create(name='Unknown user', username='unknown_user')
self.area = Area.objects.create(
name="Test Area",
area_type="Locality",
geom=Polygon(((0.0, 0.0), (0.0, 1.0), (1.1, 1.0), (1.0, 0.0), (0.0, 0.0))),
)
self.localities = [
"Delambre Island",
"Thevenard Island",
"Port Hedland",
"Rosemary Island",
"Eco Beach",
"Barrow Island",
"Mundabullangana",
"Ningaloo",
]
for locality in self.localities:
Area.objects.create(name=locality, area_type="Locality", geom=Polygon(((0.0, 0.0), (0.0, 1.0), (1.1, 1.0), (1.0, 0.0), (0.0, 0.0))))

@patch('logging.getLogger')
def test_flag_nests_with_training_in_site_name(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

training_area = Area.objects.create(
name="training site",
area_type="Locality",
geom=Polygon(((0.0, 0.0), (0.0, 1.0), (1.1, 1.0), (1.0, 0.0), (0.0, 0.0))),
)

TurtleNestEncounter.objects.create(
site=training_area,
status=Encounter.STATUS_IMPORTED,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)
call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to site containing "Training"')

@patch('logging.getLogger')
def test_flag_multiple_nests_with_training_in_site_name(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

training_area = Area.objects.create(
name="training site",
area_type="Locality",
geom=Polygon(((0.0, 0.0), (0.0, 1.0), (1.1, 1.0), (1.0, 0.0), (0.0, 0.0))),
)

for _ in range(3):
TurtleNestEncounter.objects.create(
site=training_area,
status=Encounter.STATUS_IMPORTED,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0),
source_id=str(uuid.uuid4()) # Ensure unique source_id
)
call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 3 turtle nest encounters for curation due to site containing "Training"')


@patch('logging.getLogger')
def test_flag_nests_with_testing_in_site_name(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

testing_area = Area.objects.create(
name="testing site",
area_type="Locality",
geom=Polygon(((0.0, 0.0), (0.0, 1.0), (1.1, 1.0), (1.0, 0.0), (0.0, 0.0))),
)

TurtleNestEncounter.objects.create(
site=testing_area,
status=Encounter.STATUS_IMPORTED,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)
call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to site containing "testing"')

@patch('logging.getLogger')
def test_flag_nests_with_uncertain_species(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

TurtleNestEncounter.objects.create(
site=self.area,
status=Encounter.STATUS_IMPORTED,
species=TURTLE_SPECIES_DEFAULT,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)
call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to uncertain species')

@patch('logging.getLogger')
def test_flag_nests_with_test_species(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

TurtleNestEncounter.objects.create(
site=self.area,
status=Encounter.STATUS_IMPORTED,
species=TEST_SPECIES,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)
call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to test species type')

@patch('logging.getLogger')
def test_flag_nests_with_uncertain_nesting_outcome(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

TurtleNestEncounter.objects.create(
site=self.area,
status=Encounter.STATUS_IMPORTED,
nest_type=NEST_TYPE_TRACK_UNSURE,
species=TURTLE_SPECIES,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)
call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to uncertain nesting outcome')

@patch('logging.getLogger')
def test_flag_nests_with_uncertain_nest_age(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

TurtleNestEncounter.objects.create(
site=self.area,
status=Encounter.STATUS_IMPORTED,
nest_age=NEST_AGE_DEFAULT,
species=TURTLE_SPECIES,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)
call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to uncertain nest age')

@patch('logging.getLogger')
def test_flag_nests_with_uncertain_predation(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

encounter = TurtleNestEncounter.objects.create(
site=self.area,
status=Encounter.STATUS_IMPORTED,
species=TURTLE_SPECIES,
nest_age=NEST_AGE,
nest_type=NEST_TYPE,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)
TurtleNestDisturbanceObservation.objects.create(
encounter=encounter,
disturbance_cause="unknown"
)
call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to uncertain predation')

TurtleNestDisturbanceTallyObservation.objects.create(
encounter=encounter,
disturbance_cause="unknown"
)
call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to uncertain predation')

@patch('logging.getLogger')
def test_flag_nests_with_specific_species_in_specific_areas(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

locality_area = Area.objects.get(name=LOCALITY)
TurtleNestEncounter.objects.create(
site=locality_area,
area=locality_area,
nest_age=NEST_AGE,
nest_type=NEST_TYPE,
status=Encounter.STATUS_IMPORTED,
species=TURTLE_SPECIFIC_SPECIES, # Leatherback turtle
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)

call_command('automated_qa_checks')
mock_logger.info.assert_any_call(f'Flagging 1 turtle nest encounters for curation: Dermochelys coriacea (Leatherback turtle) at {locality_area.name}')

@patch('logging.getLogger')
def test_flag_nests_with_specific_species_in_ningaloo(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

ningaloo_area = Area.objects.get(name="Ningaloo")

TurtleNestEncounter.objects.create(
site=ningaloo_area,
area=ningaloo_area,
nest_age=NEST_AGE,
nest_type=NEST_TYPE,
status=Encounter.STATUS_IMPORTED,
species=TURTLE_SPECIFIC_SPECIES,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)

call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation: Dermochelys coriacea (Leatherback turtle) at Ningaloo')

@patch('logging.getLogger')
def test_flag_imported_nests_with_unknown_reporter(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

TurtleNestEncounter.objects.create(
site=self.area,
status=Encounter.STATUS_IMPORTED,
species=TURTLE_SPECIES,
nest_age=NEST_AGE,
nest_type=NEST_TYPE,
reporter=self.unknown_user,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)

call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation due to unknown reporter')

@patch('logging.getLogger')
def test_mark_imported_nests_as_curated(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

TurtleNestEncounter.objects.create(
site=self.area,
status=Encounter.STATUS_IMPORTED,
species=TURTLE_SPECIES,
nest_age=NEST_AGE,
nest_type=NEST_TYPE,
reporter=self.system_user,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)

call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Marking 1 imported turtle nest encounters as curated (passed QA/QC checks)')

@patch('logging.getLogger')
def test_flag_imported_animal_encounters_with_unknown_reporter(self, mock_get_logger):
mock_logger = MagicMock()
mock_get_logger.return_value = mock_logger

AnimalEncounter.objects.create(
site=self.area,
status=Encounter.STATUS_IMPORTED,
species=TURTLE_SPECIES,
reporter=self.unknown_user,
when=datetime.now(pytz.utc),
where=Point(0.0, 0.0)
)

call_command('automated_qa_checks')
print(mock_logger.info.call_args_list)
mock_logger.info.assert_any_call('Flagging 1 animal encounters for curation due to unknown reporter')
Loading