Move user-list to userprofile app

     Fix permission bug
parent 062634d2
Pipeline #1751 passed with stages
in 2 minutes and 1 second
from django.conf.urls import url
from rp.views.articles import ArticleListFlux, ArticleEdit, ArticleDetailView, ArticleList
from rp.views.users import UserListView
urlpatterns = [
url(
......@@ -43,10 +42,5 @@ urlpatterns = [
r"^article/preview/(?P<pk>\d+)",
ArticleDetailView.as_view(preview=True),
name="article-preview"
),
url(
r"^user",
UserListView.as_view(),
name="user-list"
)
]
from django.conf.urls import url
from userprofile.views.users import UserListView
urlpatterns = [
url(
r"^user",
UserListView.as_view(),
name="user-list"
)
]
from django.shortcuts import render
# Create your views here.
......@@ -6,8 +6,8 @@ from django.views.generic.list import ListView
class UserListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
model = User
paginate_by = 20
template_name = 'rp/user_list.html'
permission_required = 'can_edit_users'
template_name = 'user/user_list.html'
permission_required = 'userprofile.can_edit_users'
def get_queryset(self):
qs = super().get_queryset()
......
......@@ -22,6 +22,7 @@ urlpatterns = [
url(r"^feeds/", include("rp.feeds.urls", namespace="feeds")),
url(r"^rp/", include("rp.urls", namespace="rp")),
url(r'^accounts/', include('allauth.urls')),
url(r"^user/", include('userprofile.urls'))
]
if settings.DEBUG:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment