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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
9865a867
authored
Apr 22, 2014
by
Oláh István Gergely
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add get to GroupList in view
parent
f77df96f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletions
+19
-1
circle/dashboard/views.py
+19
-1
No files found.
circle/dashboard/views.py
View file @
9865a867
...
...
@@ -46,7 +46,7 @@ from vm.models import (
)
from
storage.models
import
Disk
from
firewall.models
import
Vlan
,
Host
,
Rule
from
.models
import
Favourite
,
Profile
from
.models
import
Favourite
,
Profile
,
GroupProfile
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -985,6 +985,24 @@ class GroupList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
table_class
=
GroupListTable
table_pagination
=
False
def
get
(
self
,
*
args
,
**
kwargs
):
user
=
self
.
request
.
user
if
self
.
request
.
is_ajax
():
groups
=
[]
if
user
.
has_module_perms
(
'auth'
):
pks
=
[
i
[
0
]
for
i
in
GroupProfile
.
get_objects_with_level
(
'operator'
,
user
)
.
values_list
(
'pk'
)]
groups
=
Group
.
objects
.
filter
(
groupprofile__in
=
pks
)
groups
=
[{
'url'
:
i
.
get_absolute_url
(),
'name'
:
i
.
name
}
for
i
in
groups
]
return
HttpResponse
(
json
.
dumps
(
list
(
groups
)),
content_type
=
"application/json"
,
)
else
:
return
super
(
VmList
,
self
)
.
get
(
*
args
,
**
kwargs
)
class
GroupUserDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
...
...
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