Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
Revue de Press
Commits
8932a1b7
Verified
Commit
8932a1b7
authored
Dec 04, 2017
by
Thibaut Broggi
Browse files
Move user-list to userprofile app
Fix permission bug
parent
062634d2
Pipeline
#1751
passed with stages
in 2 minutes and 1 second
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/rp/urls.py
View file @
8932a1b7
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"
)
]
apps/
rp
/templates/r
p
/user_list.html
→
apps/
userprofile
/templates/
use
r/user_list.html
View file @
8932a1b7
File moved
apps/userprofile/urls.py
0 → 100644
View file @
8932a1b7
from
django.conf.urls
import
url
from
userprofile.views.users
import
UserListView
urlpatterns
=
[
url
(
r
"^user"
,
UserListView
.
as_view
(),
name
=
"user-list"
)
]
apps/userprofile/views.py
deleted
100644 → 0
View file @
062634d2
from
django.shortcuts
import
render
# Create your views here.
apps/
rp
/views/users.py
→
apps/
userprofile
/views/users.py
View file @
8932a1b7
...
...
@@ -6,8 +6,8 @@ from django.views.generic.list import ListView
class
UserListView
(
LoginRequiredMixin
,
PermissionRequiredMixin
,
ListView
):
model
=
User
paginate_by
=
20
template_name
=
'r
p
/user_list.html'
permission_required
=
'can_edit_users'
template_name
=
'
use
r/user_list.html'
permission_required
=
'
userprofile.
can_edit_users'
def
get_queryset
(
self
):
qs
=
super
().
get_queryset
()
...
...
project/urls.py
View file @
8932a1b7
...
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment