Example #1
0
 def test_updating_user_data(self):
     """
     Test custom view to allow users to update their details
     """
     user = mommy.make(User, username="******",
                       first_name="Test",
                       last_name="User",
                       )
     url = reverse('profile:update_profile')
     request = self.factory.post(
         url, {'username': user.username,
               'first_name': 'Fred', 'last_name': user.last_name}
     )
     request.user = user
     view = ProfileUpdateView.as_view()
     resp = view(request)
     updated_user = User.objects.get(username="******")
     self.assertEquals(updated_user.first_name, "Fred")
Example #2
0
 def test_updating_user_data(self):
     """
     Test custom view to allow users to update their details
     """
     user = mommy.make(
         User,
         username="******",
         first_name="Test",
         last_name="User",
     )
     url = reverse('profile:update_profile')
     request = self.factory.post(
         url, {
             'username': user.username,
             'first_name': 'Fred',
             'last_name': user.last_name
         })
     request.user = user
     view = ProfileUpdateView.as_view()
     resp = view(request)
     updated_user = User.objects.get(username="******")
     self.assertEquals(updated_user.first_name, "Fred")
Example #3
0
from django.urls import path
from accounts.views import cookie_policy, data_privacy_policy, profile, \
    ProfileUpdateView, DisclaimerCreateView, SignedDataPrivacyCreateView, \
    DisclaimerContactUpdateView, ChildUserCreateView, ManagedProfileUpdateView

app_name = "accounts"

urlpatterns = [
    path('profile/update/', ProfileUpdateView.as_view(),
         name='update_profile'),
    path('profile/<int:user_id>/update/',
         ManagedProfileUpdateView.as_view(),
         name='update_managed_profile'),
    path('managed-user/register/',
         ChildUserCreateView.as_view(),
         name='register_child_user'),
    path('disclaimer/<int:user_id>/',
         DisclaimerCreateView.as_view(),
         name='disclaimer_form'),
    path('emergency-contact/<int:user_id>/update/',
         DisclaimerContactUpdateView.as_view(),
         name='update_emergency_contact'),
    path('data-privacy-review/',
         SignedDataPrivacyCreateView.as_view(),
         name='data_privacy_review'),
    path('data-privacy-policy/',
         data_privacy_policy,
         name='data_privacy_policy'),
    path('cookie-policy/', cookie_policy, name='cookie_policy'),
    path('profile/', profile, name='profile'),
]
Example #4
0
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.auth.views import login, logout

from accounts.views import ProfileDetailView, ProfileUpdateView


admin.autodiscover()

urlpatterns = patterns(
    '',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', ProfileDetailView.as_view(), name='profile_detail'),
    url(r'^accounts/login/$', login, {'template_name': 'accounts/login.html'}, name='login'),
    url(r'^accounts/logout/$', logout, {'next_page': '/'}, name='logout'),
    url(r'^profile/$', ProfileUpdateView.as_view(), name='profile_update')
)
Example #5
0
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path
from . import views
from accounts.views import ProfileCreateView,\
    ProfileUpdateView,\
    ProfileDeleteView,\
    ProfileDetailView,\
    ProfileListView,\
    NewsFeed

app_name = 'accounts'


urlpatterns = [
    path('login/', LoginView.as_view(template_name='accounts/login.html'), name='login'),
    path('accounts/logout/', LogoutView.as_view(), name='logout', kwargs={'next_page': '/'}),
    path('signup/', views.SignUp.as_view(), name='signup'),
    path('', views.SignupTemplateView.as_view(), name='signup_home'),
    path('userprofile/list/', ProfileListView.as_view(), name='list'),
    path('userprofile/<int:pk>/', ProfileDetailView.as_view(), name='detail'),
    path('userprofile/create/', ProfileCreateView.as_view(), name='create'),
    path('userprofile/<int:pk>/update/', ProfileUpdateView.as_view(), name='update'),
    path('userprofile/<int:pk>/delete/', ProfileDeleteView.as_view(), name='delete'),
    path('userprofile/', NewsFeed.as_view(), name='newsfeed')

]
Example #6
0
from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy

from accounts.views import ProfileDetailView, ProfileUpdateView, CurrentUserView


urlpatterns = patterns('',
    url(r'^current.json', CurrentUserView.as_view(), name='current'),
    url(r'^update/$',
        ProfileUpdateView.as_view(),
        name='update'),
    url(r'^(?P<username>[\w-]+)/detail/$',
        ProfileDetailView.as_view(),
        name='detail'),
    url(r'^login/$',
        'django.contrib.auth.views.login',
        {'template_name': 'registration/login.html'},
        name='auth_login'),
    url(r'^logout/$',
        'django.contrib.auth.views.logout',
        {'template_name': 'registration/logout.html', 'next_page': reverse_lazy('tools:home')},
        name='auth_logout'),
    url(r'^password/change/$',
        'django.contrib.auth.views.password_change',
        name='auth_password_change'),
    url(r'^password/change/done/$',
        'django.contrib.auth.views.password_change_done',
        name='auth_password_change_done'),


)
Example #7
0
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import path

from accounts.views import RegistrationView, ProfileDetailView, ProfileUpdateView

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('register/', RegistrationView.as_view(), name='register'),
    path('user/<int:pk>/', ProfileDetailView.as_view(), name='profile_detail'),
    path('user/<int:pk>/update/',
         ProfileUpdateView.as_view(),
         name='profile_update')
]

app_name = 'accounts'
from django.conf.urls import include, url
from django.contrib.auth.decorators import login_required
from accounts.views import (ProfileDetailView, ProfileUpdateView)

urlpatterns = [
    url(r'^profile/$',
        login_required(ProfileDetailView.as_view()),
        name='profile'),
    url(r'^profile/edit/$',
        login_required(ProfileUpdateView.as_view()),
        name='profile_edit'),
    url(r'^', include('allauth.account.urls')),
]
Example #9
0
            'from_email': settings.EMAIL_HOST_USER,
            'template_name': 'accounts/password_reset_form.html',
            'subject_template_name':
            'accounts/email/password_reset_subject.txt'
        },
        name='password_reset'),
    url(r'password_reset/done/$',
        'django.contrib.auth.views.password_reset_done',
        {'template_name': 'accounts/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})/$',
        'django.contrib.auth.views.password_reset_confirm', {
            'template_name': 'accounts/password_reset_confirm.html',
        },
        name="password_reset_confirm"),
    url(r'^reset/done/$',
        'django.contrib.auth.views.password_reset_complete',
        {'template_name': 'accounts/password_reset_complete.html'},
        name='password_reset_complete'),
    url(r'^password_change/$',
        'django.contrib.auth.views.password_change',
        {'template_name': 'accounts/password_change_form.html'},
        name='password_change'),
    url(r'^password_change/done/$',
        'django.contrib.auth.views.password_change_done',
        {'template_name': 'accounts/password_change_done.html'},
        name='password_change_done'),
    url(r'register/$', RegisterView.as_view(), name='user-register'),
    url(r'update/$', ProfileUpdateView.as_view(), name='user-update'),
)
Example #10
0
from django.urls import path

from accounts.views import SignUp, ProfileUpdateView

urlpatterns = [
    path('signup/', SignUp.as_view(), name='signup'),
    path('<int:pk>/edit/', ProfileUpdateView.as_view(), name='edit-profile')
]
from django.urls import include, path
from django.contrib.auth.decorators import login_required
from accounts.views import (
    ProfileDetailView, ProfileUpdateView,
    TeamCreateView, TeamUpdateView, TeamListView,
    TeamMemberCreateView)


urlpatterns = [
    path('', include('allauth.urls')),
    path('profile/', login_required(
        ProfileDetailView.as_view()), name='profile'),
    path('profile/edit/', login_required(
        ProfileUpdateView.as_view()), name='profile_edit'),
    path('teams/', login_required(
        TeamListView.as_view()), name='team_list'),
    path('teams/create', login_required(
        TeamCreateView.as_view()), name='team_create'),
    path('teams/edit/<int:pk>', login_required(
        TeamUpdateView.as_view()), name='team_edit'),
    path('teams/invitemember/<int:team_pk>', login_required(
        TeamMemberCreateView.as_view()), name='team_member_invite'),

]
Example #12
0
from django.conf.urls import url
from accounts.views import ProfileUpdateView, profile

urlpatterns = [
    url(r'^update/$', ProfileUpdateView.as_view(), name='update_profile'),
    url(r'^$', profile, name='profile'),
    ]
Example #13
0
from django.urls import path
from accounts.views import register, ProfileUpdateView

urlpatterns = [
    path('signup/', register, name='media-signup-page'),
    path('profile/update/', ProfileUpdateView.as_view(), name='update-profile')
]
Example #14
0
# -*- coding: utf-8 -*-
from django.urls import path

from accounts.ajax import UserAutocompleteView
from accounts.views import ProfileUpdateView

base_urlpatterns = [
    path(route='<slug:slug>/', view=ProfileUpdateView.as_view(), name='index'),
]

ajax_urlpatterns = [
    path(route='search/user/',
         view=UserAutocompleteView.as_view(),
         name='user-search'),
]

urlpatterns = base_urlpatterns + ajax_urlpatterns
Example #15
0
File: urls.py Project: mono57/aden
        '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)
Example #16
0
    '',
    url(r'login/$', custom_login, {'template_name': 'accounts/login.html'},
        name='login'),
    url(r'logout/$', custom_logout, name='logout'),
    url(r'password_reset/$', 'django.contrib.auth.views.password_reset',
        {'from_email': settings.EMAIL_HOST_USER,
         'template_name': 'accounts/password_reset_form.html',
         'subject_template_name': 'accounts/email/password_reset_subject.txt'},
        name='password_reset'),
    url(r'password_reset/done/$',
        'django.contrib.auth.views.password_reset_done',
        {'template_name': 'accounts/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})/$',
        'django.contrib.auth.views.password_reset_confirm',
        {'template_name': 'accounts/password_reset_confirm.html',},
        name="password_reset_confirm"),
    url(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete',
        {'template_name': 'accounts/password_reset_complete.html'},
        name='password_reset_complete'),
    url(r'^password_change/$', 'django.contrib.auth.views.password_change',
        {'template_name': 'accounts/password_change_form.html'},
        name='password_change'),
    url(r'^password_change/done/$',
        'django.contrib.auth.views.password_change_done',
        {'template_name': 'accounts/password_change_done.html'},
        name='password_change_done'),
    url(r'register/$', RegisterView.as_view(), name='user-register'),
    url(r'update/$', ProfileUpdateView.as_view(), name='user-update'),
)
Example #17
0
from django.urls import path
from accounts.views import ProfileView, UserHomeRedirectView, ProfileUpdateView


urlpatterns = [
    path('<int:pk>/<slug:username>/', ProfileView.as_view(), name='my_profile'),
    path('update/<int:pk>/<slug:username>/', ProfileUpdateView.as_view(), name='update_profile'),
    path('redirect', UserHomeRedirectView.as_view(), name='redirect')
]
Example #18
0
from django.contrib import admin
from django.urls import path, include
from accounts.views import Signup_create_view, HomePageView, ProfileUpdateView, ProfileView
from django.contrib.auth.views import LoginView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView
from django.contrib.auth.views import PasswordChangeView, PasswordChangeDoneView, PasswordResetCompleteView, LogoutView
urlpatterns = [
    path('', HomePageView.as_view(), name='home'),
    path('login/',
         LoginView.as_view(template_name='account/login.html'),
         name='login'),
    path('logout/',
         LogoutView.as_view(template_name='account/logout.html'),
         name='logout'),
    path('profile', ProfileView.as_view(), name='profile'),
    path('edit-profile/', ProfileUpdateView.as_view(), name='edit-profile'),
    path('signup', Signup_create_view.as_view(), name='signup'),
    path('password-reset/',
         PasswordResetView.as_view(
             template_name='account/password_reset_form.html',
             email_template_name='account/password_reset_email.html'),
         name='password_reset'),
    path('password-reset/done/',
         PasswordResetDoneView.as_view(
             template_name='account/password_reset_done.html'),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name='account/password_confirm.html'),
         name='password_reset_confirm'),
    path('reset/done/',
         PasswordResetCompleteView.as_view(
Example #19
0
from django.conf.urls import url
from accounts.views import ProfileUpdateView, profile

urlpatterns = [
    url(r'^update/$', ProfileUpdateView.as_view(), name='update_profile'),
    url(r'^$', profile, name='profile'),
]
Example #20
0
    PhoneVerificationView, RequestNewVerificationCodeView, ProfileUpdateView
from listings.views import AllReviewsView, OwnerListingView, ListingCreateView,\
    ListingDetailView, ListingUpdateView, TicketSearchView, ListingDeleteView, \
    ReviewUserView, IndexView, transaction_update
from events.views import event_json, venue_json
from allauth.account.views import login
admin.autodiscover()

urlpatterns = [
    url(r'^$', IndexView.as_view(), name="home"),
    url(r'^accounts/login/$', login, name="login"), # login url for things that need it
    url(r'^accounts/', include('allauth.urls')),
    url(r'^verify_phone/$', PhoneVerificationView.as_view(), name="phone_verification"),
    url(r'^verify_phone/new/$', RequestNewVerificationCodeView.as_view(), name="new_verification_code"),
    url(r'^profile/$', OwnUserProfileView.as_view(), name="profile"),
    url(r'^profile/edit/$', ProfileUpdateView.as_view(), name="edit_profile"),
    url(r'^users/(?P<pk>[0-9]+)/$', UserProfileView.as_view(), name="profile_user"),
    url(r'^users/(?P<pk>[0-9]+)/reviews/$', AllReviewsView.as_view(), name="all_reviews_view"),
    url(r'^users/(?P<pk>[0-9]+)/listings/$', OwnerListingView.as_view(), name="owner_list_view"),
    url(r'^events/', include('events.event_urls')),
    url(r'^venues/', include('events.venue_urls')),

    url(r'^listings/$', TicketSearchView.as_view(), name="ticket_list"),
    url(r'^listings/create/$', ListingCreateView.as_view(), name="post"),
    url(r'^listings/(?P<pk>[0-9]+)/$',ListingDetailView.as_view(), name="ticket_view"),
    url(r'^listings/(?P<pk>[0-9]+)/edit/$',ListingUpdateView.as_view(), name="ticket_edit"),
    url(r'^listings/(?P<pk>[0-9]+)/delete/$',ListingDeleteView.as_view(), name="ticket_delete"),

    url(r'^reviews/(?P<transaction_id>[0-9]+)/create/$', ReviewUserView.as_view(), name="create_review"),

    url(r'^list/event/', event_json),