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

Audit logs for creation and updates to verification requests #582

Merged
merged 1 commit into from
May 3, 2024

Conversation

mrchrisadams
Copy link
Member

This PR introduces use of the django log entry feature to provide a more accessible audit log when staff or users are working with verification requests.

@@ -1448,6 +1450,25 @@ def send_approval_email(
template_html="emails/verification_request_approved.html",
)

def log_message(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This convenience method is intended to make it much easier to log changes we make that might not otherwise be made in the admin

@@ -279,6 +283,26 @@ class Steps(Enum):
Steps.PREVIEW.value: "provider_registration/preview.html",
}

def log_creation(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows us to log various events to the django log_entries table, from outside the admin.

It's used outside approve() method for a provider request because access to the user in a given request is required.

If we created a "robot" user, we coud use this same approach for logging automated updates too, but that's outside the scope of this PR.

@mrchrisadams mrchrisadams merged commit a3acf8c into master May 3, 2024
1 check passed
@mrchrisadams
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant