question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why send activation email on user update?

See original GitHub issue

If sending activation emails is enabled (SEND_ACTIVATION_EMAIL == True), updating a user currently sends an activation email!

https://github.com/sunscrapers/djoser/blob/master/djoser/views.py#L148:

class UserViewSet(viewsets.ModelViewSet):
    ...
    def perform_update(self, serializer):
        super().perform_update(serializer)
        user = serializer.instance
        # should we send activation email after update?
        if settings.SEND_ACTIVATION_EMAIL:
            context = {"user": user}
            to = [get_user_email(user)]
            settings.EMAIL.activation(self.request, context).send(to)

What’s the purpose of sending an activation email with an activation link in this scenario (updating a user)? The account is already activated, and will remain activated after the update. A confirmation email would be understandable, but an activation email is puzzling.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

15reactions
akhayyatcommented, Oct 13, 2020

Right. That makes sense when the email is changed. But a user may be updated without changing their email. In fact, in my case, email is the username. So, changing it requires using the “set username” endpoint. The email field is a read-only field in my user serializer.

But to accommodate the general case, wouldn’t it make sense to send an activation email only if the email field is changed?

4reactions
Saksowcommented, Apr 17, 2022

Any plans to release this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sending activation email - Account Management API
An activation email can be sent only to user accounts located in sub-tenants. Authenticate to the cloud platform via the Python shell. The...
Read more >
(Djoser) Weird activation email when I update the user fields
Every time when I try to update my user with the PATCH method to the /users/me/ endpoint, an activation email is always sent....
Read more >
Users not receiving activation email on secondary email address
Adding a secondary email address when the user gets created will also mandate that emails for activating the account will be sent to...
Read more >
Prepare and Send Activation Link to registered User Email ...
In this lecture you will learn how to prepare and send an account activation link to users as they register, you will also...
Read more >
Account Activation Emails Are Only Sent Once - Salesforce Help
Account activation emails are now only sent once. Previously, these emails were sent daily for seven days....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found