Skip to content

Commit

Permalink
Merge branch 'master' into v2.1.0prod
Browse files Browse the repository at this point in the history
  • Loading branch information
RickWangPerth authored Oct 24, 2024
2 parents 4b24381 + abc6b48 commit de8b422
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/image-build-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
# Build and push Docker image (not on PR)
#----------------------------------------------
- name: Build and push Docker image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down
1 change: 1 addition & 0 deletions kustomize/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ patches:
images:
- name: ghcr.io/dbca-wa/wastd
newTag: 2.1.0

5 changes: 4 additions & 1 deletion marine_mammal_incidents/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ class Incident(models.Model):
ENTRAPMENT = 'Entrapment'
VESSEL_COLLISION = 'Vessel collision'
UNUSUAL_MORTALITY_EVENT = 'Unusual mortality event'
HAULED_OUT = 'Hauled-out'
INCIDENT_TYPE_CHOICES = [
(STRANDING, 'Stranding'),
(ENTANGLEMENT, 'Entanglement'),
(ENTRAPMENT, 'Entrapment'),
(VESSEL_COLLISION, 'Vessel collision'),
(UNUSUAL_MORTALITY_EVENT, 'Unusual mortality event')
(UNUSUAL_MORTALITY_EVENT, 'Unusual mortality event'),
(HAULED_OUT, 'Hauled-out (for pinnipeds)')

]
incident_type = models.CharField(max_length=50,choices=INCIDENT_TYPE_CHOICES)

Expand Down
4 changes: 2 additions & 2 deletions observations/tests/test_management_commands_auto_qa_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def test_flag_imported_nests_with_unknown_reporter(self, mock_get_logger):
)

call_command('automated_qa_checks')
mock_logger.info.assert_any_call('Flagging 1 turtle nest encounters for curation: unknown reporter')
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):
Expand Down Expand Up @@ -312,4 +312,4 @@ def test_flag_imported_animal_encounters_with_unknown_reporter(self, mock_get_lo

call_command('automated_qa_checks')
print(mock_logger.info.call_args_list)
mock_logger.info.assert_any_call('Flagging 1 animal encounters for curation: unknown reporter')
mock_logger.info.assert_any_call('Flagging 1 animal encounters for curation due to unknown reporter')
1 change: 1 addition & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tool.poetry]
name = "wastd"
version = "2.1.0"

description = "Western Australian Sea Turtles Database"
authors = ["Florian Mayer <florian.mayer@dbca.wa.gov.au>", "Ashley Felton <ashley.felton@dbca.wa.gov.au>","Evan Hallein <evan.hallein@dbca.wa.gov.au>", "Rick Wang <rick.wang@dbca.wa.gov.au>"]
license = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion wamtram2/static/js/tagValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,15 @@ document.addEventListener('DOMContentLoaded', function() {
fetch(url)
.then(response => response.json())
.then(data => {
console.log('RESPONSE DATA:',data);
if (data.valid && !data.wrong_side) {
if (data.message && data.message.includes('Tag found in previous unprocessed entry')) {
setValidationStatus(tagInput, validationMessage, detailedMessage, 'valid', '✓ Tag found in previous unprocessed entry');
} else {
setValidationStatus(tagInput, validationMessage, detailedMessage, 'valid', '✓ Valid tag');
}
// doNotProcessField.checked = false;
} else if (data.message && data.message.includes('Tag found in previous unprocessed entry')) {
setValidationStatus(tagInput, validationMessage, detailedMessage, 'valid', '✓ Tag found in previous unprocessed entry');
} else if (data.wrong_side) {
setValidationStatus(tagInput, validationMessage, detailedMessage, 'warning', '! Tag may be on the wrong side');
doNotProcessField.checked = true;
Expand Down
1 change: 0 additions & 1 deletion wamtram2/templates/wamtram2/find_turtle.html
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ <h5 class="text-center mt-4">Create for a Tagged Turtle</h5>
showLoadingSpinner(); // Show spinner for page navigation
showLoadingOverlay(); // Show overlay for page navigation
setTimeout(function() {
console.log('Submitting form');
document.getElementById('searchForm').submit();
}, 500);
break;
Expand Down
2 changes: 0 additions & 2 deletions wamtram2/templates/wamtram2/trtdataentry_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,6 @@ <h5 class="modal-title" id="summaryModalLabel">Summary of Your Inputs</h5>
document.getElementById('search_measured_recorded_by').value = measuredRecordedByFullName;
}
} else if (templateId) {
console.log("No entry ID, using selected template ID:", templateId);

const defaultPlaceCode = "{{ default_place_code|escapejs }}";
const defaultPlaceFullName = "{{ default_place_full_name|escapejs }}";
Expand All @@ -1110,7 +1109,6 @@ <h5 class="modal-title" id="summaryModalLabel">Summary of Your Inputs</h5>

// Set the tag and validate
if (cookieTagId && cookieTagType) {
console.log("Setting tag for", cookieTagType, "with ID:", cookieTagId);
if (cookieTagType === 'recapture_tag') {
if (cookieTagSide === 'L') {
setTagAndValidate('id_recapture_left_tag_id', cookieTagId);
Expand Down
1 change: 1 addition & 0 deletions wastd/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def readiness(self, request):
cursor = connections["default"].cursor()
cursor.execute("SELECT 1;")
row = cursor.fetchone()
cursor.close()
if row is None:
return HttpResponseServerError("db: invalid response")
except Exception as e:
Expand Down

0 comments on commit de8b422

Please sign in to comment.