Skip to content
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

Can't update the email address ! #374

Open
1 task done
MidouWebDev opened this issue May 15, 2021 · 22 comments · May be fixed by #461
Open
1 task done

Can't update the email address ! #374

MidouWebDev opened this issue May 15, 2021 · 22 comments · May be fixed by #461
Assignees
Labels
bug Something isn't working

Comments

@MidouWebDev
Copy link
Collaborator

Preflight Checklist

  • 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 MidouWebDev added the bug Something isn't working label May 15, 2021
@MidouWebDev MidouWebDev added this to To Do in Tasks - Mumble via automation May 15, 2021
@Leopold-V
Copy link
Contributor

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 .

@MidouWebDev
Copy link
Collaborator Author

@Leopold-V thanks bro

I will check this with @PraveenMalethia

@MidouWebDev
Copy link
Collaborator Author

@PraveenMalethia

@ishitb
Copy link
Contributor

ishitb commented May 31, 2021

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.

@MidouWebDev
Copy link
Collaborator Author

MidouWebDev commented May 31, 2021

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

Tasks - Mumble automation moved this from To Do to Done Jun 3, 2021
@MidouWebDev MidouWebDev reopened this Jun 3, 2021
Tasks - Mumble automation moved this from Done to To Do Jun 3, 2021
@MidouWebDev MidouWebDev changed the title Can't update my email address in the profile settings Can't update the email address ! Jun 3, 2021
@MidouWebDev MidouWebDev self-assigned this Jun 5, 2021
@PraveenMalethia
Copy link
Collaborator

Oh, I see , will look at that !

@PraveenMalethia
Copy link
Collaborator

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

@MidouWebDev MidouWebDev removed their assignment Jun 5, 2021
@mani-barathi
Copy link
Contributor

mani-barathi commented Jun 5, 2021

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

@MidouWebDev
Copy link
Collaborator Author

@mani-barathi okey, thanks !

@mani-barathi
Copy link
Contributor

@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?

@MidouWebDev
Copy link
Collaborator Author

@PraveenMalethia

@PraveenMalethia
Copy link
Collaborator

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!

@mani-barathi
Copy link
Contributor

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

@okumujustine
Copy link
Contributor

okumujustine commented Jun 20, 2021

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

@okumujustine
Copy link
Contributor

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

@mani-barathi
Copy link
Contributor

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.

@okumujustine
Copy link
Contributor

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.

@mani-barathi
Copy link
Contributor

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

@okumujustine
Copy link
Contributor

@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.

@PraveenMalethia
Copy link
Collaborator

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

@okumujustine
Copy link
Contributor

okumujustine commented Jun 22, 2021

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

@mani-barathi
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Tasks - Mumble
  
To Do
Development

Successfully merging a pull request may close this issue.

6 participants