Skip to content

Commit

Permalink
Fix default_url_generator
Browse files Browse the repository at this point in the history
This is the URL that this module defines:

    dj_rest_auth/urls.py:    path('password/reset/confirm/', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'),

As such, the URL name it should use is rest_password_reset_confirm.

Also, remove false documentation, which recommended to define a
password_reset_confirm URL "like in the demo" but the demo includes this
URL, with rest_password_reset_confirm, not password_reset_confirm:

    path('password/reset/confirm/', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'),
  • Loading branch information
jpic committed Apr 3, 2024
1 parent 069cd11 commit 617e143
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dj_rest_auth/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

def default_url_generator(request, user, temp_key):
path = reverse(
'password_reset_confirm',
'rest_password_reset_confirm',
args=[user_pk_to_url_str(user), temp_key],
)

Expand Down
10 changes: 2 additions & 8 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ FAQ
If you don't want to use API on that step, then just use ConfirmEmailView view from:
django-allauth https://github.com/pennersr/django-allauth/blob/master/allauth/account/views.py


2. I get an error: Reverse for 'password_reset_confirm' not found.

You need to add `password_reset_confirm` url into your ``urls.py`` (at the top of any other included urls). Please check the ``urls.py`` module inside demo app example for more details.


3. How can I update UserProfile assigned to User model?
2. How can I update UserProfile assigned to User model?

Assuming you already have UserProfile model defined like this

Expand All @@ -42,7 +36,7 @@ FAQ
from rest_framework import serializers
from dj_rest_auth.serializers import UserDetailsSerializer
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = UserProfile
Expand Down

0 comments on commit 617e143

Please sign in to comment.