Closed jonas87 closed 5 years ago
hey @jonas87 the admin_approve_complete_email
context (https://github.com/macropin/django-registration/blob/master/registration/models.py#L693) and the activation_email
context (https://github.com/macropin/django-registration/blob/master/registration/models.py#L419) have a user
variable present, this just wasn't documented properly. Added docs in: https://github.com/macropin/django-registration/pull/349
Thanks for the links @joshblum, I see the problem now. In virtually all templates the user context variable gives access to the full user object (self.user). In admin_approve_complete_email however the user variable refers to self.user.get_username(). That's a bit inconsistent? I was calling user.first_name in all my templates, which I see now of course works in the self.user templates but not in the self.user.get_username() templates. I will define get_username() then in my user model to work around this
Ah you’re right, I’ll drop make the full user available, sorry I missed that when I was looking earlier
The admin_approve_complete_email context is missing the user variable. In for example the activation_email template, the user variable is available. It makes sense to have the user also available in admin_approve_complete_email since both of these templates are for emails that are send to the new user.