Commit 95f722a1 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

Rename users_quotas to astakos_users_quotas

parent 3e888700
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
from django.core.management.base import BaseCommand, CommandError from django.core.management.base import BaseCommand, CommandError
from astakos.im.models import AstakosUser, get_latest_terms 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 astakos.im.util import model_to_dict
from synnefo.lib.ordereddict import OrderedDict from synnefo.lib.ordereddict import OrderedDict
...@@ -67,7 +67,7 @@ class Command(BaseCommand): ...@@ -67,7 +67,7 @@ class Command(BaseCommand):
raise CommandError(msg) raise CommandError(msg)
for user in users: for user in users:
quotas = user_quotas(user) quotas = astakos_user_quotas(user)
settings_dict = {} settings_dict = {}
settings = user.settings() settings = user.settings()
......
...@@ -163,7 +163,7 @@ def get_grant_source(grant): ...@@ -163,7 +163,7 @@ def get_grant_source(grant):
return SYSTEM return SYSTEM
def users_quotas(users, initial=None): def astakos_users_quotas(users, initial=None):
if initial is None: if initial is None:
quotas = initial_quotas(users) quotas = initial_quotas(users)
else: else:
...@@ -209,8 +209,8 @@ def users_quotas(users, initial=None): ...@@ -209,8 +209,8 @@ def users_quotas(users, initial=None):
return quotas return quotas
def user_quotas(user): def astakos_user_quotas(user):
quotas = users_quotas([user]) quotas = astakos_users_quotas([user])
try: try:
return quotas[user.uuid] return quotas[user.uuid]
except KeyError: except KeyError:
...@@ -220,7 +220,7 @@ def user_quotas(user): ...@@ -220,7 +220,7 @@ def user_quotas(user):
def list_user_quotas(users): def list_user_quotas(users):
qh_quotas, qh_limits = get_users_quotas_and_limits(users) qh_quotas, qh_limits = get_users_quotas_and_limits(users)
astakos_initial = initial_quotas(users) astakos_initial = initial_quotas(users)
astakos_quotas = users_quotas(users) astakos_quotas = astakos_users_quotas(users)
diff_quotas = {} diff_quotas = {}
for holder, local in astakos_quotas.iteritems(): for holder, local in astakos_quotas.iteritems():
...@@ -257,7 +257,7 @@ def qh_sync_new_resource(resource, limit): ...@@ -257,7 +257,7 @@ def qh_sync_new_resource(resource, limit):
def qh_sync_users(user_ids): def qh_sync_users(user_ids):
users = AstakosUser.forupdate.filter(id__in=user_ids).select_for_update() 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) set_user_quota(astakos_quotas)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment