Skip to content

Commit

Permalink
Add a Log When Creating a UEI Validation Waiver (#4123)
Browse files Browse the repository at this point in the history
* Log UEI validation waivers on addition by admin

* Fix a typo in a comment
  • Loading branch information
jperson1 committed Jul 31, 2024
1 parent 7e2cfc4 commit 841f6e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/api/test_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_expired_waived_uei_payload(self):
expiration=expired["expiration"],
)

# Invalid due to the waiver being expired. Mock the SAM call as though the entity doesnt exist.
# Invalid due to the waiver being expired. Mock the SAM call as though the entity does not exist.
with patch("api.uei.SESSION.get") as mock_get:
mock_get.return_value.status_code = 200
mock_get.return_value.json.return_value = json.loads(missing_uei_results)
Expand Down
6 changes: 6 additions & 0 deletions backend/audit/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ class UeiValidationWaiverAdmin(admin.ModelAdmin):
)
readonly_fields = ("timestamp",)

def save_model(self, request, obj, form, change):
super().save_model(request, obj, form, change)
logger.info(
f'Validation Waiver for UEI "{obj.uei}" successfully added by user: {request.user.email}.'
)


admin.site.register(Access, AccessAdmin)
admin.site.register(DeletedAccess, DeletedAccessAdmin)
Expand Down

0 comments on commit 841f6e0

Please sign in to comment.