Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
11
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9661b18e
authored
Apr 15, 2020
by
Chif Gergő
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix field error in Q expression
parent
08480ef1
Pipeline
#1067
failed with stage
in 1 minute 28 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
recircle/instance/models.py
+1
-1
recircle/instance/views.py
+1
-1
No files found.
recircle/instance/models.py
View file @
9661b18e
...
...
@@ -178,7 +178,7 @@ class Instance(BaseMachineDescriptor):
@classmethod
def
create
(
cls
,
lease
,
owner
,
flavor
,
template
,
remote_id
,
params
):
params
[
"password"
]
=
cls
.
generate_password
()
inst
=
cls
(
lease
=
lease
,
flavor
=
flavor
,
owner
=
owner
,
system_type
=
template
.
system_type
,
inst
=
cls
(
lease
=
lease
,
flavor
=
flavor
,
created_by
=
owner
,
system_type
=
template
.
system_type
,
distro
=
template
.
distro
,
access_protocol
=
template
.
access_protocol
,
remote_id
=
remote_id
,
template
=
template
,
status
=
"CREATING"
,
**
params
)
...
...
recircle/instance/views.py
View file @
9661b18e
...
...
@@ -72,7 +72,7 @@ class InstanceViewSet(AuthorizationMixin, ViewSet):
status
=
status
.
HTTP_401_UNAUTHORIZED
)
params
=
request
.
data
template
=
ImageTemplate
.
objects
.
get
(
Q
(
pk
=
params
[
"template"
])
&
(
Q
(
own
ed_by
=
request
.
user
)
|
Q
(
type
=
"SYSTEM"
)))
(
Q
(
creat
ed_by
=
request
.
user
)
|
Q
(
type
=
"SYSTEM"
)))
if
not
template
:
return
Response
({
"error"
:
"No permission to use this template."
},
status
=
status
.
HTTP_401_UNAUTHORIZED
)
...
...
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