Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0e9039cf
authored
Apr 22, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix GroupList
parent
656289ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
circle/dashboard/views.py
+7
-12
No files found.
circle/dashboard/views.py
View file @
0e9039cf
...
@@ -981,17 +981,15 @@ class NodeList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
...
@@ -981,17 +981,15 @@ class NodeList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
class
GroupList
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
SingleTableView
):
class
GroupList
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
SingleTableView
):
template_name
=
"dashboard/group-list.html"
template_name
=
"dashboard/group-list.html"
modul
=
Group
table_class
=
GroupListTable
table_class
=
GroupListTable
table_pagination
=
False
table_pagination
=
False
def
get
(
self
,
*
args
,
**
kwargs
):
def
get
(
self
,
*
args
,
**
kwargs
):
user
=
self
.
request
.
user
if
self
.
request
.
is_ajax
():
if
self
.
request
.
is_ajax
():
groups
=
[]
pks
=
[
i
[
0
]
for
i
in
GroupProfile
.
get_objects_with_level
(
if
user
.
has_module_perms
(
'auth'
):
'operator'
,
self
.
request
.
user
)
.
values_list
(
'pk'
)]
pks
=
[
i
[
0
]
for
i
in
GroupProfile
.
get_objects_with_level
(
groups
=
Group
.
objects
.
filter
(
groupprofile__in
=
pks
)
'operator'
,
user
)
.
values_list
(
'pk'
)]
groups
=
Group
.
objects
.
filter
(
groupprofile__in
=
pks
)
groups
=
[{
groups
=
[{
'url'
:
reverse
(
"dashboard.views.group-detail"
,
'url'
:
reverse
(
"dashboard.views.group-detail"
,
kwargs
=
{
'pk'
:
i
.
pk
}),
kwargs
=
{
'pk'
:
i
.
pk
}),
...
@@ -1004,14 +1002,11 @@ class GroupList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
...
@@ -1004,14 +1002,11 @@ class GroupList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
return
super
(
GroupList
,
self
)
.
get
(
*
args
,
**
kwargs
)
return
super
(
GroupList
,
self
)
.
get
(
*
args
,
**
kwargs
)
def
get_queryset
(
self
):
def
get_queryset
(
self
):
user
=
self
.
request
.
user
logger
.
debug
(
'GroupList.get_queryset() called. User:
%
s'
,
logger
.
debug
(
'GroupList.get_queryset() called. User:
%
s'
,
unicode
(
self
.
request
.
user
))
unicode
(
self
.
request
.
user
))
groups
=
[]
pks
=
[
i
[
0
]
for
i
in
GroupProfile
.
get_objects_with_level
(
if
user
.
has_module_perms
(
'auth'
):
'operator'
,
self
.
request
.
user
)
.
values_list
(
'pk'
)]
pks
=
[
i
[
0
]
for
i
in
GroupProfile
.
get_objects_with_level
(
groups
=
Group
.
objects
.
filter
(
groupprofile__in
=
pks
)
'operator'
,
user
)
.
values_list
(
'pk'
)]
groups
=
Group
.
objects
.
filter
(
groupprofile__in
=
pks
)
s
=
self
.
request
.
GET
.
get
(
"s"
)
s
=
self
.
request
.
GET
.
get
(
"s"
)
if
s
:
if
s
:
groups
=
groups
.
filter
(
name__icontains
=
s
)
groups
=
groups
.
filter
(
name__icontains
=
s
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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