Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5dfb3014
authored
Feb 12, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
one: make default template name unique
parent
8ac3399f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
one/templates/new-template-flow.html
+2
-2
one/views.py
+5
-0
No files found.
one/templates/new-template-flow.html
View file @
5dfb3014
...
...
@@ -16,8 +16,8 @@
<ul>
<li>
<label
for=
"new-template-name"
>
{% trans "Name" %}
</label>
<input
type=
"text"
name=
"name"
id=
"new-template-name"
value=
"{{base.name}}"
class=
"
error validated"
title=
"{% trans "
Please
choose
a
different
name
."
%}
"
/>
<input
type=
"text"
name=
"name"
id=
"new-template-name"
value=
"{{base.name}}
{{maxshare}}
"
class=
"
validated
"
/>
<div
class=
"clear"
></div>
</li>
<li
class=
"new-tpl-size"
>
...
...
one/views.py
View file @
5dfb3014
...
...
@@ -132,9 +132,14 @@ class AjaxTemplateWizard(View):
base
=
get_object_or_404
(
Template
,
id
=
request
.
POST
[
'base'
])
if
base
.
owner
!=
request
.
user
and
not
base
.
public
and
not
request
.
user
.
is_superuser
:
raise
PermissionDenied
()
try
:
maxshare
=
Template
.
objects
.
order_by
(
'-pk'
)[
0
]
.
pk
+
1
except
:
maxshare
=
1
return
render_to_response
(
'new-template-flow.html'
,
RequestContext
(
request
,
{
'sizes'
:
InstanceType
.
objects
.
all
(),
'base'
:
base
,
'maxshare'
:
maxshare
,
}))
ajax_template_wizard
=
login_required
(
AjaxTemplateWizard
.
as_view
())
...
...
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