def test_get_object(self, user: settings.AUTH_USER_MODEL,
                        request_factory: RequestFactory):
        view = UserUpdateView()
        request = request_factory.get("/fake-url/")
        request.user = user

        view.request = request

        assert view.get_object() == user
    def test_get_success_url(self, user: settings.AUTH_USER_MODEL,
                             request_factory: RequestFactory):
        view = UserUpdateView()
        request = request_factory.get("/fake-url/")
        request.user = user

        view.request = request

        assert view.get_success_url() == f"/accounts/{user.username}/"
Beispiel #3
0
from django.urls import path, include
from accounts.views import index, UserUpdateView, scanner
from django.contrib.auth.decorators import login_required

urlpatterns = [
    path('', index, name='index'),
    path('scanner/', scanner, name='scanner'),
    path('my_account',
         login_required(UserUpdateView.as_view()),
         name='my_account'),
]
Beispiel #4
0
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from django.contrib import admin

from accounts.views import (signup, UserAccountView, UserUpdateView)
from boards.views import BoardListView

urlpatterns = [
    url(r'^admin/', admin.site.urls),

    # accounts
    url(r'^account/$', UserAccountView.as_view(), name='account-detail'),
    url(r'^account/update/$', UserUpdateView.as_view(), name='account-update'),

    # boards
    url(r'^$', BoardListView.as_view(), name='home'),
    url(r'^boards/', include('boards.urls', namespace='boards')),

    # auth
    url(r'^signup/$', signup, name='signup'),
    url(r'^login/$',
        auth_views.LoginView.as_view(template_name='accounts/login.html'),
        name='login'),
    url(r'^logout/$', auth_views.LogoutView.as_view(), name='logout'),
    url(r'^password/change/$',
        auth_views.PasswordChangeView.as_view(),
        name='password_change'),
    url(r'^password/change/done/$',
        auth_views.PasswordChangeDoneView.as_view(),
        name='password_change_done'),
    url(r'^password/reset/$',
Beispiel #5
0
from django.urls import path

from django.contrib.auth.views import LoginView, LogoutView
from accounts.views import RegisterView, UserDetailView, UsersListView, UserUpdateView, UserPasswordChangeView

app_name = 'accounts'

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('registration/', RegisterView.as_view(), name='registration'),
    path('profile/', UserUpdateView.as_view(), name='update_profile'),
    path('<int:pk>/', UserDetailView.as_view(), name='detail'),
    path('users/', UsersListView.as_view(), name='users'),
    path('change_password/',
         UserPasswordChangeView.as_view(),
         name='change_password'),
]
from django.urls import path
from accounts.views import UserCreateView, UserListView, UserDetailedView, UserUpdateView, UserDeleteView, generate_csv

app_name = 'accounts'

urlpatterns = [
    path('create_user/', UserCreateView.as_view(), name="create_user"),
    path('user_list/', UserListView.as_view(), name="user_list"),
    path('users/<pk>/', UserDetailedView.as_view(), name="user_detail"),
    path('update/<pk>/', UserUpdateView.as_view(), name="user_update"),
    path('delete/<pk>/', UserDeleteView.as_view(), name="user_delete"),
    path('user_list/generate_csv/', generate_csv, name="generate_csv")
]
Beispiel #7
0
from django.urls import path

from accounts.views import login_view, logout_view, register_view, UserDetailView, UserUpdateView, \
    UserUpdatePasswordView

urlpatterns = [
    path('login/', login_view, name='login'),
    path('logout/', logout_view, name='logout'),
    path('registration/', register_view, name='registration'),
    path('logout/', logout_view, name='logout'),
    path('profile/<int:pk>/', UserDetailView.as_view(), name='user_detail'),
    path('profile/update/<int:pk>/',
         UserUpdateView.as_view(),
         name='user_update'),
    path('profile/update_password/<int:pk>/',
         UserUpdatePasswordView.as_view(),
         name='user_change_password')
]

app_name = 'accounts'
Beispiel #8
0
            UserProfileView.as_view(),
            name='view_profile'),
        url(r'^accounts/profile/(?P<pk>\d+)/items$',
            accounts.views.UserEditorItemSearchView.as_view(),
            name='profile_editoritem_search'),
        url(r'^accounts/profile/(?P<pk>\d+)/projects$',
            accounts.views.UserProjectsView.as_view(),
            name='profile_projects'),
        url(r'^accounts/profile/(?P<pk>\d+)/themes$',
            accounts.views.UserThemesView.as_view(),
            name='profile_themes'),
        url(r'^accounts/profile/(?P<pk>\d+)/extensions$',
            accounts.views.UserExtensionsView.as_view(),
            name='profile_extensions'),
        url(r'^accounts/profile/edit$',
            login_required(UserUpdateView.as_view()),
            name='edit_profile'),
        url(r'^accounts/profile/backup/all-exams$',
            login_required(AllExamsView.as_view()),
            name='all_exams_download'),
        url(r'^accounts/profile/backup/all-questions$',
            login_required(AllQuestionsView.as_view()),
            name='all_questions_download'),
        )

if settings.CAN_CHANGE_PASSWORD:
    urlpatterns += patterns('',
        url(r'^accounts/profile/change-password$',
            login_required(ChangePasswordView.as_view()),
            name='change_password'
        ),
Beispiel #9
0
}

password_reset_configuration = {
    'post_reset_redirect': 'password_reset_done'
}

password_done_configuration = {
    'post_reset_redirect': 'password_reset_complete'
}

urlpatterns = [
    url(r'^' + BASE_URL + 'password-reset/$', auth_views.password_reset, password_reset_configuration, name='password_reset'),
    url(r'^' + BASE_URL + 'password-reset/done/$', auth_views.password_reset_done, name='password_reset_done'),
    url(r'^' + BASE_URL + 'password-reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', auth_views.password_reset_confirm, password_done_configuration, name='password_reset_confirm'),
    url(r'^' + BASE_URL + 'password-reset/completed/$', auth_views.password_reset_complete, name='password_reset_complete'),
    url(r'^' + BASE_URL + 'admin/', admin.site.urls),
    url(r'^' + BASE_URL + 'login/$', auth_views.login, login_configuration, name='login'),
    url(r'^' + BASE_URL + 'logout/$', auth_views.logout, logout_configuration, name='logout'),
    url(r'^' + BASE_URL + 'register/$', UserRegistrationView.as_view(), name='user_registration'),
    url(r'^' + BASE_URL + 'account/$', UserUpdateView.as_view(), name='user_account'),
    url(r'^' + BASE_URL + 'api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    url(r'^' + BASE_URL + 'hydroshare/', include('hydroshare.urls', namespace='hydroshare')),
    url(BASE_URL, include('dataloaderinterface.urls')),
    url(BASE_URL, include('dataloaderservices.urls'))
]

# if settings.DEBUG:
#     import debug_toolbar
#     urlpatterns = [
#         url(r'^__debug__/', include(debug_toolbar.urls)),
#     ] + urlpatterns
Beispiel #10
0
from django.contrib.auth.views import LoginView, LogoutView
from django.urls.conf import path

from accounts.views import RegistrationView, UserUpdateView, \
    UserPasswordChangeView

app_name = 'accounts'

urlpatterns = [
    path('login/',
         LoginView.as_view(template_name='accounts/login.html'),
         name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('password_change/',
         UserPasswordChangeView.as_view(),
         name='password_change'),
    #     path('password_change/done/', views.PasswordChangeDoneView.as_view(), name='password_change_done'),

    #     path('password_reset/', views.PasswordResetView.as_view(), name='password_reset'),
    #     path('password_reset/done/', views.PasswordResetDoneView.as_view(), name='password_reset_done'),
    #     path('reset/<uidb64>/<token>/', views.PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    #     path('reset/done/', views.PasswordResetCompleteView.as_view(), name='password_reset_complete'),
    path('register/', RegistrationView.as_view(), name='register'),
    path('update/', UserUpdateView.as_view(), name='update'),
    path('password_change/',
         UserPasswordChangeView.as_view(),
         name='password_change')
]
Beispiel #11
0
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path

from accounts.views import UserRegisterView, UserDetailView, UserUpdateView, PasswordChangeView

app_name = 'accounts'

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('register/', UserRegisterView.as_view(), name='register'),
    path('<int:pk>/detail/', UserDetailView.as_view(), name='user-detail'),
    path('user/<int:pk>/edit/', UserUpdateView.as_view(), name='user-edit'),
    path('user/<int:pk>/password/change',
         PasswordChangeView.as_view(),
         name='password-edit'),
]
Beispiel #12
0
"""ユーザー登録に関するurls.py"""
from django.urls import path
from accounts.views import SignUpView, SignOutView, UserDetailView, UserUpdateView

app_name = 'accounts'

urlpatterns = [
    path('signup/', SignUpView.as_view(), name='signup'),
    path('<int:pk>/signout/', SignOutView.as_view(), name='signout'),
    path('<int:pk>/detail/', UserDetailView.as_view(), name='detail'),
    path('<int:pk>/update/', UserUpdateView.as_view(), name='update'),
    ]
Beispiel #13
0
        'internal_regulation/',
        InternalRegulationTemplateView.as_view(),
        name='regulation',
    ),
    path(
        'status/',
        StatusTemplateView.as_view(),
        name='status'
    ),
    path('legal_mentions/',
        LegalMentions.as_view(),
        name='legal_mentions'
    ),
    path('accounts/', include('allauth.urls')),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('tinymce/', include('tinymce.urls')),
    path('accounts/profile/', ProfileUpdateView.as_view(), name='account_profile'),
    path('accounts/user/update/', UserUpdateView.as_view(),
         name='account_user_update'),
    path('com/', include('com.urls', namespace='com')),
    path('network/', include('network.urls', namespace='network')),
    path('carriere/', include('carriere.urls', namespace='carriere')),
    path('project/', include('project.urls', namespace='project')),
    path('aden/', include('us.urls', namespace='aden')),
    path('i18n/', include('django.conf.urls.i18n')),
    path('admin/staff/', admin.site.urls),
    prefix_default_language = False
)
urlpatterns = i18n_url + \
    static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Beispiel #14
0
from django.urls import path
from django.contrib.auth.views import LoginView, LogoutView

from accounts.views import register_view, UserDetailView, UserUpdateView, UserPasswordChangeView

app_name = 'accounts'

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('registration/', register_view, name='registration'),
    path('user/<int:pk>/', UserDetailView.as_view(), name='user-detail'),
    path('user/update/<int:pk>/', UserUpdateView.as_view(),
         name='user-update'),
    path('change-password/',
         UserPasswordChangeView.as_view(),
         name='change-password')
]
Beispiel #15
0
         PasswordResetDoneView.as_view(
             template_name='password_reset_done.html'),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name='password_reset_confirm.html'),
         name='password_reset_confirm'),
    path('reset/complete/',
         PasswordResetCompleteView.as_view(
             template_name='password_reset_complete.html'),
         name='password_reset_complete'),
    path('settings/password/',
         PasswordChangeView.as_view(template_name='password_change.html'),
         name='password_change'),
    path('settings/password/done/',
         PasswordChangeDoneView.as_view(
             template_name='password_change_done.html'),
         name='password_change_done'),
    path('settings/account/', UserUpdateView.as_view(), name='my_account'),
    # path('boards/<pk>/topics/<topic_pk>/', topic_posts, name='topic_posts'),
    path('boards/<pk>/topics/<topic_pk>/',
         PostListView.as_view(),
         name='topic_posts'),
    path('boards/<pk>/topics/<topic_pk>/reply/',
         reply_topic,
         name='reply_topic'),
    path('boards/<pk>/topics/<topic_pk>/posts/<post_pk>/edit/',
         PostUpdateView.as_view(),
         name='edit_post'),
]
Beispiel #16
0
from django.urls import path
from django.contrib.auth.views import LogoutView
from accounts.views import LoginView, SignUp, UserDetailView, UserUpdateView, UserDeleteView, UserPasswordChangeView, \
    UserListView, UserSearchView, SearchResultsView, BanChangeView

app_name = 'accounts'

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('create/', SignUp.as_view(), name='create'),
    path('profile/<int:pk>/', UserDetailView.as_view(), name='user_detail'),
    path('profile/<int:pk>/update/', UserUpdateView.as_view(), name='user_update'),
    path('profile/<int:pk>/delete/', UserDeleteView.as_view(), name='user_delete'),
    path('profile/<int:pk>/change_password/', UserPasswordChangeView.as_view(), name='user_change_password'),
    path('profile/list/', UserListView.as_view(), name='user_list'),
    path('user/search/', UserSearchView.as_view(), name='user_search'),
    path('user/search/results/', SearchResultsView.as_view(), name='search_results'),
    path('users/change_ban/<int:pk>/', BanChangeView.as_view(), name="ban_change"),

]
Beispiel #17
0
from django.urls import path
from django.contrib.auth.views import LoginView, LogoutView

from accounts.views import signup, UserUpdateView

app_name = 'accounts'
urlpatterns = [
    path('signup/', signup, name='signup'),
    path('login/', LoginView.as_view(
        template_name='accounts/login.html'), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('ac/', UserUpdateView.as_view(), name='account'),
]
Beispiel #18
0
    UserDetailView,
    UserUpdateView,
    UserDeleteView,
    CampOwnerFollowToggle,
    AllUsers,
    # Validation URLS
    validate_username,
    validate_email,
    ban_user,
)

app_name = 'users'

user_patterns = [
    path('<username>/', UserDetailView.as_view(), name='user_detail'),
    path('<username>/update/', UserUpdateView.as_view(), name='user_update'),
    path('<username>/delete/', UserDeleteView.as_view(), name='user_delete'),
    path('follow', CampOwnerFollowToggle.as_view(), name='campowner_follow'),
    path('allUsers', AllUsers.as_view(), name='all_users'),
    path('ban_user', ban_user, name='ban_user'),
]

validate_patterns = [
    path('username/', validate_username, name="validate_username"),
    path('email/', validate_email, name="validate_email"),
]

urlpatterns = [
    # Login, Logout, Register
    path('login/',
         LoginView.as_view(template_name='accounts/registration/login.html',
Beispiel #19
0
from django.urls import path

from accounts.views import LoginView, LogoutView, UserCreateView, UserListView, UserUpdateView

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('user/add/', UserCreateView.as_view(), name='user-add'),
    path('user/list/', UserListView.as_view(), name='user-list'),
    path('user/update/<pk>', UserUpdateView.as_view(), name="user-update"),
]
Beispiel #20
0
from django.contrib import admin
from django.urls import path
from django.conf.urls import url
from django.contrib.auth import views as auth_views

from boards.views import new_topic, reply_topic, PostListView, PostUpdateView, BoardListView, TopicListView
from accounts.views import signup_views, UserUpdateView

urlpatterns = [
    url(r'^$', BoardListView.as_view(), name='home'),
    url(r'^login/$',
        auth_views.LoginView.as_view(template_name='login.html'),
        name='login'),
    url(r'^logout/$', auth_views.LogoutView.as_view(), name='logout'),
    url(r'^signup/$', signup_views, name="signup"),
    url(r'^settings/account/$', UserUpdateView.as_view(), name='my_account'),
    path('admin/', admin.site.urls),
    url(r'^reset/$',
        auth_views.PasswordResetView.as_view(
            template_name="password_reset.html",
            email_template_name="password_reset_email.html",
            subject_template_name="password_reset_subject.txt"),
        name='password_reset'),
    url(r'^reset/done/$',
        auth_views.PasswordResetDoneView.as_view(
            template_name="password_reset_done.html"),
        name="password_reset_done"),
    url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        auth_views.PasswordResetConfirmView.as_view(),
        name="password_reset_confirm"),
    url(r'^reset/complete/$',
Beispiel #21
0
from django.urls import path
from accounts.views import UserLogoutView, login_view, register_view, UserDetailView, UserUpdateView, \
    UserPasswordChangeView, UserListView, TeamAddView, TeamRemoveView

urlpatterns = [
    path('login/', login_view, name='login' ),
    path('logout/', UserLogoutView.as_view(), name='logout'),
    path('register/', register_view, name='register'),
    path('<int:pk>/', UserDetailView.as_view(), name='user details'),
    path('<int:pk>/edit', UserUpdateView.as_view(), name='update user info'),
    path('<int:pk>/password', UserPasswordChangeView.as_view(), name='change user password'),
    path('users/', UserListView.as_view(), name='list users'),

    path('project/<int:pk>/team/add/', TeamAddView.as_view(), name='add team member'),
    path('project/team/remove/<int:pk>/', TeamRemoveView.as_view(), name='remove member from team')
]


app_name='accounts'