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
47e1ff1d
authored
Apr 12, 2021
by
Máhonfai Bálint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add convert to JSON to group profile for export
parent
0ef7d002
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
circle/dashboard/models.py
+19
-0
No files found.
circle/dashboard/models.py
View file @
47e1ff1d
...
@@ -357,6 +357,25 @@ class GroupProfile(AclBase):
...
@@ -357,6 +357,25 @@ class GroupProfile(AclBase):
group
.
delete
()
group
.
delete
()
logger
.
error
(
"Invalid group JSON"
)
logger
.
error
(
"Invalid group JSON"
)
def
convert_to_json
(
self
):
json_group
=
{
"name"
:
self
.
group
.
name
,
"desc"
:
self
.
description
,
"org_id"
:
self
.
org_id
,
"instance_limit"
:
self
.
instance_limit
,
"template_instance_limit"
:
self
.
template_instance_limit
,
"disk_quota"
:
self
.
disk_quota
,
"users"
:
[
user
.
profile
.
org_id
for
user
in
self
.
group
.
user_set
.
all
()
],
"permissions"
:
[
permission
.
natural_key
()
for
permission
in
self
.
group
.
permissions
.
all
()
]
}
return
json
.
dumps
(
json_group
)
def
get_or_create_profile
(
self
):
def
get_or_create_profile
(
self
):
obj
,
created
=
GroupProfile
.
objects
.
get_or_create
(
group_id
=
self
.
pk
)
obj
,
created
=
GroupProfile
.
objects
.
get_or_create
(
group_id
=
self
.
pk
)
...
...
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