Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
c93e0444
Commit
c93e0444
authored
Dec 19, 2012
by
Olga Brani
Browse files
Fix update resources bug
parent
b34d5588
Changes
4
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/forms.py
View file @
c93e0444
...
...
@@ -964,7 +964,8 @@ class ProjectApplicationForm(forms.ModelForm):
if
uplimit
:
append
(
dict
(
service
=
s
,
resource
=
r
,
uplimit
=
uplimit
))
else
:
append
(
dict
(
service
=
s
,
resource
=
r
,
uplimit
=
None
))
append
(
dict
(
service
=
s
,
resource
=
r
,
uplimit
=
None
))
return
policies
...
...
snf-astakos-app/astakos/im/models.py
View file @
c93e0444
...
...
@@ -1399,6 +1399,11 @@ class ProjectApplication(models.Model):
resource
=
Resource
.
objects
.
get
(
service__name
=
service
,
name
=
resource
)
q
.
create
(
resource
=
resource
,
member_capacity
=
uplimit
)
@
property
def
grants
(
self
):
return
self
.
projectresourcegrant_set
.
values
(
'member_capacity'
,
'resource__name'
,
'resource__service__name'
)
@
property
def
resource_policies
(
self
):
return
self
.
projectresourcegrant_set
.
all
()
...
...
snf-astakos-app/astakos/im/templates/im/projects/projectapplication_form.html
View file @
c93e0444
{% extends "im/account_base.html" %}
{% load filters %}
{% load astakos_tags %}
{% block headjs %}
{{ block.super }}
<script
src=
"{{ IM_STATIC_URL }}js/quotas.js"
></script>
...
...
@@ -8,7 +9,8 @@
{% block page.body %}
{% with resource_catalog|populated_resource_catalog as resource_catalog%}
{% with resource_catalog|populated_resource_catalog as resource_catalog %}
{% if show_form %}
<form
action=
"?verify=1#top"
method=
"post"
class=
"withlabels quotas-form"
id=
"group_create_form"
>
{% csrf_token %}
...
...
@@ -94,6 +96,8 @@
{%
with
rname
|
add:
'
_uplimit
'
as
input_value
%}
value =
"{{ request.POST|lookup:input_value }}"
{%
endwith
%}
{%
else
%}
value =
"{% get_grant_value rname form %}"
{%
endif
%}
/>
<span
class=
"extra-img"
>
</span>
...
...
snf-astakos-app/astakos/im/templatetags/astakos_tags.py
View file @
c93e0444
...
...
@@ -68,4 +68,14 @@ class MessagesNode(template.Node):
@
register
.
simple_tag
def
olga
(
v
):
return
v
+
'a'
\ No newline at end of file
return
v
+
'a'
@
register
.
simple_tag
def
get_grant_value
(
rname
,
form
):
grants
=
form
.
instance
.
grants
service_name
,
resource_name
=
rname
.
split
(
'.'
,
1
)
try
:
return
form
.
instance
.
projectresourcegrant_set
.
get
(
resource__name
=
resource_name
,
resource__service__name
=
service_name
).
member_capacity
except
:
return
''
\ No newline at end of file
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