Mumble icon indicating copy to clipboard operation
Mumble copied to clipboard

Can't update the email address !

Open MidouWebDev opened this issue 3 years ago • 22 comments

Preflight Checklist

  • [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Describe the bug

I can't update my email address in the profile settings

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'mumble.dev'
  2. Click on 'profile'
  3. Scroll down to 'settings'
  4. Try to update the email address
  5. See Error

Expected behavior

I expected to be able to update my email address like for the avatar

Screenshots

MidouWebDev avatar May 15 '21 21:05 MidouWebDev

Hi @MidouWebDev I think it is a backend issue because whatever we modify in the user setting page, a request is sent to the api/users/profile_update/ route and always answer with an undefined email field : https://i.gyazo.com/9f3172e087236a062e49a0c17cac74bc.png .

Leopold-V avatar May 20 '21 14:05 Leopold-V

@Leopold-V thanks bro

I will check this with @PraveenMalethia

MidouWebDev avatar May 20 '21 17:05 MidouWebDev

@PraveenMalethia

MidouWebDev avatar May 22 '21 10:05 MidouWebDev

Hi @MidouWebDev I think it is a backend issue because whatever we modify in the user setting page, a request is sent to the api/users/profile_update/ route and always answer with an undefined email field : https://i.gyazo.com/9f3172e087236a062e49a0c17cac74bc.png .

An addition to this. Looking at the code it seems like the issue is that the 'api/users/profile_update/' endpoint, only updates the fields that are in the UserProfile model, and since the actual email is part of the django user model, it's not being updated.

ishitb avatar May 31 '21 12:05 ishitb

Hi @MidouWebDev I think it is a backend issue because whatever we modify in the user setting page, a request is sent to the api/users/profile_update/ route and always answer with an undefined email field : https://i.gyazo.com/9f3172e087236a062e49a0c17cac74bc.png .

An addition to this. Looking at the code it seems like the issue is that the 'api/users/profile_update/' endpoint, only updates the fields that are in the UserProfile model, and since the actual email is part of the django user model, it's not being updated.

Yeah, Thanks That's what @Leopold-V also mentionned, i am waiting for @PraveenMalethia 's opinion

MidouWebDev avatar May 31 '21 12:05 MidouWebDev

Oh, I see , will look at that !

PraveenMalethia avatar Jun 05 '21 09:06 PraveenMalethia

i have updated the view to also modify the email field, which is of the default user model provided by Django !

PraveenMalethia avatar Jun 05 '21 09:06 PraveenMalethia

@MidouWebDev Assign it to me, I'll start working on this tomorrow

mani-barathi avatar Jun 05 '21 17:06 mani-barathi

@mani-barathi okey, thanks !

MidouWebDev avatar Jun 05 '21 17:06 MidouWebDev

@MidouWebDev There is nothing to change in the frontend regarding the email update. If the user tries to update the email, we are making a proper request to the backend with the new email as a payload. But in the response, the email field is not present. I checked the backend route I think line number 248 should be after line number 256, such that response is created after the user object being updated with the new email.

image

@PraveenMalethia what's your thought on this?

mani-barathi avatar Jun 06 '21 05:06 mani-barathi

@PraveenMalethia

MidouWebDev avatar Jun 06 '21 08:06 MidouWebDev

check the new_email which is received in the 'email' payload and if that is None! then it will be assigned to the user profile!

PraveenMalethia avatar Jun 09 '21 08:06 PraveenMalethia

@PraveenMalethia Email is not received in the user or the profile object.

mani-barathi avatar Jun 09 '21 13:06 mani-barathi

Looks like the email update API is already working on my side? @PraveenMalethia

okumujustine avatar Jun 20 '21 21:06 okumujustine

However, the frontend changes reflect after refreshing the page. ezgif com-gif-maker (2)

okumujustine avatar Jun 20 '21 21:06 okumujustine

I get that. The backend is updating the email but it's not sending the updated email back in the response. Because of that we are not able to update the email with new email in front-end.

mani-barathi avatar Jun 21 '21 04:06 mani-barathi

I get that. The backend is updating the email but it's not sending the updated email back in the response. Because of that we are not able to update the email with new email in front-end.

Okay, i get that @mani-barathi .

A temporary solution would be to monitor success (in .then) where the API call is being made from and set the email to the entered email. Or set to the previous email in case of API call failure (in .catch) if backend will delay.

okumujustine avatar Jun 21 '21 07:06 okumujustine

@MidouWebDev should I implement the temporary fix suggested by @okumujustine

mani-barathi avatar Jun 21 '21 07:06 mani-barathi

@MidouWebDev should I implement the temporary fix suggested by @okumujustine

That will be great, @Mr-spShuvo you could assign @mani-barathi on this if it's okay.

okumujustine avatar Jun 21 '21 07:06 okumujustine

Backend is updated to return updated email in response. Now you can update the frontend!

PraveenMalethia avatar Jun 22 '21 02:06 PraveenMalethia

@mani-barathi , you are working on this !?

okumujustine avatar Jun 22 '21 12:06 okumujustine

@okumujustine I did make a simple temporary change, but if you what to take this issue go ahead and do it. Here is the link to PR I made. Mr-spShuvo was requesting some changes so have a look into that.

mani-barathi avatar Jun 22 '21 12:06 mani-barathi