Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
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
961a5f71
authored
Sep 11, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: use mixin in record create view to set owner
parent
338c3960
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
circle/network/views.py
+3
-3
No files found.
circle/network/views.py
View file @
961a5f71
...
@@ -495,21 +495,21 @@ class RecordCreate(LoginRequiredMixin, SuperuserRequiredMixin,
...
@@ -495,21 +495,21 @@ class RecordCreate(LoginRequiredMixin, SuperuserRequiredMixin,
success_message
=
_
(
u'Successfully created record!'
)
success_message
=
_
(
u'Successfully created record!'
)
def
get_initial
(
self
):
def
get_initial
(
self
):
initial
=
super
(
RecordCreate
,
self
)
.
get_initial
()
initial
[
'domain'
]
=
self
.
request
.
GET
.
get
(
'domain'
)
host_pk
=
self
.
request
.
GET
.
get
(
"host"
)
host_pk
=
self
.
request
.
GET
.
get
(
"host"
)
try
:
try
:
host
=
Host
.
objects
.
get
(
pk
=
host_pk
)
host
=
Host
.
objects
.
get
(
pk
=
host_pk
)
except
(
Host
.
DoesNotExist
,
ValueError
):
except
(
Host
.
DoesNotExist
,
ValueError
):
host
=
None
host
=
None
initial
=
{
'owner'
:
self
.
request
.
user
}
if
host
:
if
host
:
initial
.
update
({
initial
.
update
({
'type'
:
"CNAME"
,
'type'
:
"CNAME"
,
'host'
:
host
,
'host'
:
host
,
'address'
:
host
.
get_fqdn
(),
'address'
:
host
.
get_fqdn
(),
})
})
else
:
initial
[
'domain'
]
=
self
.
request
.
GET
.
get
(
'domain'
)
return
initial
return
initial
...
...
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