Closed armish closed 9 years ago
Awesome, thanks for doing this. I'm still looking through/commenting, but wanted to ask if the reason for the Anonymous user was for passing seltest tests (the only time I can think of that we have Anonymous users)?
Thanks for the comments @ihodes -- keep them coming :)
About the Anonymous user and the need for seltests: yes and no -- seltests are the only place where we set LOGIN_DISABLED=true
and it helped uncover a bug: current_user
cannot be serialized into JSON when the user is anonymous (see examine.html
). I added that class just to make sure that it is serializable and the whole implementation behaves normally when the user anonymous (hence the username
and null
id
).
There might be other workarounds for this, but I thought that this might be good way for us to move forwards where we can customize the fields for Anonymous user and reduce the complexity of the code in other places.
This looks great; a few mostly minor comments. This really exposed you to the whole Cycledash stack now :) Thanks for handling this!
Thanks @ihodes, this was really fun to work on. The latest changes address all your comments/suggestions.
Awesome, thanks--looks good to merge once you get it to go green!
Mind squashing those commits down a bit, first?
This PR deprecates #813 and adds support for proper associations between comments and their authors. With this change, we get rid of the
Author Name
field from theCommentBox
and automatically assign user to a new comment: if the user logged in, then the comments belong to that user; if not, it is anonymous. If the user authentication is not enabled, all comments will be anonymous.This PR requires a minor update to our DB schema and hence features an alembic migration script. During migration, all of our comments will lose their
author_name
information and therefore will become anonymous.Here are some screenshots to get a feeling of how this looks now: