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

Add the email / username of the last user to edit #643

Merged
merged 1 commit into from
Dec 6, 2017

Conversation

ddohler
Copy link
Contributor

@ddohler ddohler commented Dec 4, 2017

Adds the email / username of the last user to edit a record to the
detail view for authenticated users. Because users can be deleted, this
falls back to the username if the user has been deleted, which is the
functionality provided by the RecordAuditLogEntry class. In cases where
the user was generated using Google authentication, the username is
unlikely to be helpful (e.g. 116570040541971129286) but it will at least
indicate that the user no longer exists.

Testing instructions

  • Open up the UI at http://localhost:7000
  • Open the developer console
  • Click through to the detail page for a record
  • Confirm that the network request for the record includes a modified_by key that contains the user's email.

Extra credit testing

I'm pretty confident these both will work because they're mostly reliant on existing, well-tested functionality, but they may be helpful to familiarize yourself with the application:

  • Use the admin interface at http://localhost:7000/editor/ to add a new user with the Public permission, log in with that user, and re-do the steps above. The modified_by key should not appear.
  • Create a user with admin or analyst privileges, and make sure that their username is different from their email. Log in as that user, edit a record. Confirm that the modified_by key for that record now matches the user's email. Now delete the user. Confirm that the modified_by key for that record now matches the user's username.

Adds the email / username of the last user to edit a record to the
detail view for authenticated users. Because users can be deleted, this
falls back to the username if the user has been deleted, which is the
functionality provided by the RecordAuditLogEntry class. In cases where
the user was generated using Google authentication, the username is
unlikely to be helpful (e.g. 116570040541971129286) but it will at least
indicate that the user no longer exists.
Copy link
Member

@jisantuc jisantuc left a comment

Choose a reason for hiding this comment

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

Did the extra credit testing as well 🎉

@ddohler ddohler merged commit 83f8687 into develop Dec 6, 2017
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.

2 participants