diff --git a/.github/workflows/image-build-scan.yml b/.github/workflows/image-build-scan.yml index 16a1446b3..351306ba9 100644 --- a/.github/workflows/image-build-scan.yml +++ b/.github/workflows/image-build-scan.yml @@ -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' }} diff --git a/kustomize/overlays/prod/kustomization.yaml b/kustomize/overlays/prod/kustomization.yaml index 79789f065..9c5130500 100644 --- a/kustomize/overlays/prod/kustomization.yaml +++ b/kustomize/overlays/prod/kustomization.yaml @@ -24,3 +24,4 @@ patches: images: - name: ghcr.io/dbca-wa/wastd newTag: 2.1.0 + diff --git a/marine_mammal_incidents/models.py b/marine_mammal_incidents/models.py index fad86bccc..89cca3644 100644 --- a/marine_mammal_incidents/models.py +++ b/marine_mammal_incidents/models.py @@ -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) diff --git a/observations/tests/test_management_commands_auto_qa_checks.py b/observations/tests/test_management_commands_auto_qa_checks.py index 0f44c241a..57504f429 100644 --- a/observations/tests/test_management_commands_auto_qa_checks.py +++ b/observations/tests/test_management_commands_auto_qa_checks.py @@ -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): @@ -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') diff --git a/poetry.lock b/poetry.lock index 7974bf517..6bfeb7611 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2389,6 +2389,7 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [[package]] name = "vulture" version = "2.13" + description = "Find dead code" optional = false python-versions = ">=3.8" diff --git a/pyproject.toml b/pyproject.toml index 6a3bb1bbc..6020f0074 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [tool.poetry] name = "wastd" version = "2.1.0" + description = "Western Australian Sea Turtles Database" authors = ["Florian Mayer ", "Ashley Felton ","Evan Hallein ", "Rick Wang "] license = "MIT" diff --git a/wamtram2/static/js/tagValidation.js b/wamtram2/static/js/tagValidation.js index 1b8cabfed..96489b66c 100644 --- a/wamtram2/static/js/tagValidation.js +++ b/wamtram2/static/js/tagValidation.js @@ -124,7 +124,6 @@ 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'); @@ -132,6 +131,8 @@ document.addEventListener('DOMContentLoaded', function() { 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; diff --git a/wamtram2/templates/wamtram2/find_turtle.html b/wamtram2/templates/wamtram2/find_turtle.html index f61b7962f..3eb74424f 100644 --- a/wamtram2/templates/wamtram2/find_turtle.html +++ b/wamtram2/templates/wamtram2/find_turtle.html @@ -296,7 +296,6 @@
Create for a Tagged Turtle
showLoadingSpinner(); // Show spinner for page navigation showLoadingOverlay(); // Show overlay for page navigation setTimeout(function() { - console.log('Submitting form'); document.getElementById('searchForm').submit(); }, 500); break; diff --git a/wamtram2/templates/wamtram2/trtdataentry_form.html b/wamtram2/templates/wamtram2/trtdataentry_form.html index 312eef39a..63ae1aa7f 100644 --- a/wamtram2/templates/wamtram2/trtdataentry_form.html +++ b/wamtram2/templates/wamtram2/trtdataentry_form.html @@ -1092,7 +1092,6 @@ 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 }}"; @@ -1110,7 +1109,6 @@ // 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); diff --git a/wastd/middleware.py b/wastd/middleware.py index 3c65cbd93..30ab20233 100644 --- a/wastd/middleware.py +++ b/wastd/middleware.py @@ -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: