You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.1 KiB
29 lines
1.1 KiB
# -*- coding: utf-8 -*-
|
|
from django.conf.urls import patterns, url
|
|
from django.core.urlresolvers import reverse_lazy
|
|
from functions.custom_views import SimpleObjectChangeView
|
|
|
|
from .admin import AccountsStatistic, DeleteAccount, EditUser, UserListView
|
|
from .models import User
|
|
|
|
attrs = {
|
|
'model': User,
|
|
'url': reverse_lazy('admin_accounts_all'),
|
|
'attr': 'blocked',
|
|
}
|
|
|
|
urlpatterns = patterns('',
|
|
url(r'^statistic/$', AccountsStatistic.as_view(), name='admin_accounts_statistic'),
|
|
url(r'^change/(?P<url>.*)/$', 'accounts.admin.user_change'),
|
|
url(r'^all/$', UserListView.as_view(), name='admin_accounts_all'),
|
|
url(r'^reset_password_email/$', 'accounts.admin.reset_password_email'),
|
|
url(r'^delete/(?P<pk>.*)/$', DeleteAccount.as_view(), name='remove_account'),
|
|
|
|
url(r'^(?P<url>.*)/block/$',
|
|
SimpleObjectChangeView.as_view(**dict(attrs, attr_state=True)),
|
|
name='admin_accounts_block'),
|
|
|
|
url(r'^(?P<url>.*)/unblock/$',
|
|
SimpleObjectChangeView.as_view(**dict(attrs, attr_state=False)),
|
|
name='admin_accounts_unblock'),
|
|
)
|
|
|