-
Notifications
You must be signed in to change notification settings - Fork 1
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 toasts and login form #7
Conversation
"user": { | ||
"is_authenticated": request.user.is_authenticated, | ||
"is_staff": request.user.is_staff, | ||
"email": request.user.email if not request.user.is_anonymous else "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think request.user.is_anonymous or ""
will suffice.
Applies to request.user.first_name
and request.user.last_name` as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand.
If you mean "email": request.user.is_anonymous or ""
, then it doesn't make sense, because we need to provide the request.user.email
value
If you mean "email": request.user.email or ""
, then it also won't work, because if user is anonymous the user.email
field doesn't exist (since then user is of type AnonymousUser
, not User
), so we get an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
This PR contains:
messages.<message_level>()
/login
form with some code that automatically generates frontend code from Django's forms<CenteredContainer/>
component, which caps width of elements based on screen size. I also refactored many other components to use it, so that the entire website behaves consistently with different screen sizes.context.user.some_property
, rather thancontext.some_property
). Custom context processors are not well documented in Reactivated, so I initially missed the fact that it can be achieved this way.