-
Notifications
You must be signed in to change notification settings - Fork 461
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
Release/3.0.0 #820
Draft
tomwojcik
wants to merge
24
commits into
master
Choose a base branch
from
release/3.0.0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Release/3.0.0 #820
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c293f47
v3 branch init
tomwojcik 46d1fd5
extract new UserViewSet without any actions
tomwojcik 29aead3
drop router from the new UserViewSet in urls
tomwojcik 872e7c2
extract me viewset
tomwojcik 6272357
move the remaining actions out of the old UserViewSet, drop the old U…
tomwojcik 0ef9f51
rm the old viewset from tests
tomwojcik 3c4b26c
align UserViewSet get_serializer_class
tomwojcik 96d1ccf
fix copy-pasted incorrect set username viewset when refactoring
tomwojcik dbf874b
fix tests, drop unused mocks
tomwojcik c272a8a
Merge branch 'refs/heads/master' into release/3.0.0
tomwojcik 26a5383
rm empty views
tomwojcik e20dc24
activation
tomwojcik 988d1c7
Merge branch 'master' into release/3.0.0
tomwojcik d6a3421
Merge remote-tracking branch 'origin/release/3.0.0' into release/3.0.0
tomwojcik f100b22
Merge branch 'refs/heads/master' into release/3.0.0
tomwojcik df5520c
updated views
tomwojcik 00065da
updated urls
tomwojcik 954390b
mv
tomwojcik c88b7c1
align some tests
tomwojcik 44ea180
mv re_path to path in jwt and auth token
tomwojcik e162b21
Merge branch 'master' into release/3.0.0
8482713
Merge branch 'master' into release/3.0.0
ed6037b
rm useless pytest.ini and python_paths that doesn't work
3b53f50
add new granular views
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
from django.urls import re_path | ||
|
||
from djoser import views | ||
from djoser.views.token.create import TokenCreateView | ||
from djoser.views.token.destroy import TokenDestroyView | ||
|
||
urlpatterns = [ | ||
re_path(r"^token/login/?$", views.TokenCreateView.as_view(), name="login"), | ||
re_path(r"^token/logout/?$", views.TokenDestroyView.as_view(), name="logout"), | ||
re_path(r"^token/login/?$", TokenCreateView.as_view(), name="login"), | ||
re_path(r"^token/logout/?$", TokenDestroyView.as_view(), name="logout"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,96 @@ | ||
from django.contrib.auth import get_user_model | ||
from rest_framework.routers import DefaultRouter | ||
from django.urls import path | ||
|
||
from djoser import views | ||
from djoser.views.user.activation import UserActivationAPIView | ||
from djoser.views.user.me import UserMeViewSet | ||
from djoser.views.user.password_reset_confirm import UserPasswordResetConfirmAPIView | ||
from djoser.views.user.resend_activation import UserResendActivationAPIView | ||
from djoser.views.user.reset_password import UserResetPasswordAPIView | ||
from djoser.views.user.reset_username import UserResetUsernameAPIView | ||
from djoser.views.user.reset_username_confirm import UserResetUsernameConfirmAPIView | ||
from djoser.views.user.set_password import UserSetPasswordAPIView | ||
from djoser.views.user.set_username import UserSetUsernameAPIView | ||
from djoser.views.user.user import UserViewSet | ||
|
||
router = DefaultRouter() | ||
router.register("users", views.UserViewSet) | ||
|
||
User = get_user_model() | ||
|
||
urlpatterns = router.urls | ||
|
||
user_activation = path( | ||
"users/activation/", UserActivationAPIView.as_view(), name="user-activation" | ||
) | ||
user_list = path( | ||
"users/", UserViewSet.as_view({"get": "list", "post": "create"}), name="user-list" | ||
) | ||
user_detail = path( | ||
f"users/<{UserViewSet.lookup_field}>/", | ||
UserViewSet.as_view( | ||
{ | ||
"get": "retrieve", | ||
"put": "update", | ||
"patch": "partial_update", | ||
"delete": "destroy", | ||
} | ||
), | ||
name="user-detail", | ||
) | ||
user_password_reset_confirm = path( | ||
"users/reset_password_confirm/", | ||
UserPasswordResetConfirmAPIView.as_view(), | ||
name="user-reset-password-confirm", | ||
) | ||
user_resend_activation = path( | ||
"users/resend-activation/", | ||
UserResendActivationAPIView.as_view(), | ||
name="user-resend-activation", | ||
) | ||
user_reset_password = path( | ||
"users/reset_password", | ||
UserResetPasswordAPIView.as_view(), | ||
name="user-reset-password", | ||
) | ||
user_reset_username = path( | ||
f"users/reset_{User.USERNAME_FIELD}", | ||
UserResetUsernameAPIView.as_view(), | ||
name="user-reset-username", | ||
) | ||
user_reset_username_confirm = path( | ||
f"users/reset_{User.USERNAME_FIELD}_confirm", | ||
UserResetUsernameConfirmAPIView.as_view(), | ||
name="user-reset-username-confirm", | ||
) | ||
user_set_password = path( | ||
"users/set_password", UserSetPasswordAPIView.as_view(), name="user-set-password" | ||
) | ||
user_set_username = path( | ||
f"users/set_{User.USERNAME_FIELD}", | ||
UserSetUsernameAPIView.as_view(), | ||
name="user-set-username", | ||
) | ||
|
||
me_list = path( | ||
"users/me/", | ||
UserMeViewSet.as_view( | ||
{ | ||
"get": "retrieve", | ||
"put": "update", | ||
"patch": "partial_update", | ||
"delete": "destroy", | ||
} | ||
), | ||
name="user-me", | ||
) | ||
|
||
urlpatterns = [ | ||
user_resend_activation, | ||
user_activation, | ||
user_password_reset_confirm, | ||
user_reset_username_confirm, | ||
user_reset_password, | ||
user_set_password, | ||
user_set_username, | ||
user_reset_username, | ||
me_list, | ||
user_detail, | ||
user_list, | ||
] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to switch to
url()
instead ofre_path
by the way of doing this views split.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
44ea180