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
0cdc712d
Commit
0cdc712d
authored
May 24, 2013
by
Giorgos Korfiatis
Browse files
astakos: Show value even for unknown resource
Do not fail when looking up the unit, if resource is not found.
parent
6a5a579a
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/management/commands/_common.py
View file @
0cdc712d
...
...
@@ -159,8 +159,9 @@ class ResourceDict(object):
def
show_resource_value
(
number
,
resource
,
style
):
resource_dict
=
ResourceDict
.
get
()
unit
=
resource_dict
[
resource
][
'unit'
]
resources
=
ResourceDict
.
get
()
resource_dict
=
resources
.
get
(
resource
)
unit
=
resource_dict
.
get
(
'unit'
)
if
resource_dict
else
None
return
units
.
show
(
number
,
unit
,
style
)
...
...
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