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
95f722a1
Commit
95f722a1
authored
Apr 22, 2013
by
Giorgos Korfiatis
Browse files
Rename users_quotas to astakos_users_quotas
parent
3e888700
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/management/commands/user-show.py
View file @
95f722a1
...
...
@@ -34,7 +34,7 @@
from
django.core.management.base
import
BaseCommand
,
CommandError
from
astakos.im.models
import
AstakosUser
,
get_latest_terms
from
astakos.im.quotas
import
user_quotas
from
astakos.im.quotas
import
astakos_
user_quotas
from
astakos.im.util
import
model_to_dict
from
synnefo.lib.ordereddict
import
OrderedDict
...
...
@@ -67,7 +67,7 @@ class Command(BaseCommand):
raise
CommandError
(
msg
)
for
user
in
users
:
quotas
=
user_quotas
(
user
)
quotas
=
astakos_
user_quotas
(
user
)
settings_dict
=
{}
settings
=
user
.
settings
()
...
...
snf-astakos-app/astakos/im/quotas.py
View file @
95f722a1
...
...
@@ -163,7 +163,7 @@ def get_grant_source(grant):
return
SYSTEM
def
users_quotas
(
users
,
initial
=
None
):
def
astakos_
users_quotas
(
users
,
initial
=
None
):
if
initial
is
None
:
quotas
=
initial_quotas
(
users
)
else
:
...
...
@@ -209,8 +209,8 @@ def users_quotas(users, initial=None):
return
quotas
def
user_quotas
(
user
):
quotas
=
users_quotas
([
user
])
def
astakos_
user_quotas
(
user
):
quotas
=
astakos_
users_quotas
([
user
])
try
:
return
quotas
[
user
.
uuid
]
except
KeyError
:
...
...
@@ -220,7 +220,7 @@ def user_quotas(user):
def
list_user_quotas
(
users
):
qh_quotas
,
qh_limits
=
get_users_quotas_and_limits
(
users
)
astakos_initial
=
initial_quotas
(
users
)
astakos_quotas
=
users_quotas
(
users
)
astakos_quotas
=
astakos_
users_quotas
(
users
)
diff_quotas
=
{}
for
holder
,
local
in
astakos_quotas
.
iteritems
():
...
...
@@ -257,7 +257,7 @@ def qh_sync_new_resource(resource, limit):
def
qh_sync_users
(
user_ids
):
users
=
AstakosUser
.
forupdate
.
filter
(
id__in
=
user_ids
).
select_for_update
()
astakos_quotas
=
users_quotas
(
list
(
users
))
astakos_quotas
=
astakos_
users_quotas
(
list
(
users
))
set_user_quota
(
astakos_quotas
)
...
...
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