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
8fd1eca0
Commit
8fd1eca0
authored
Apr 22, 2013
by
Giorgos Korfiatis
Browse files
Sync user after changing base quota
parent
bf8e4fc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/management/commands/user-set-initial-quota.py
View file @
8fd1eca0
...
...
@@ -41,7 +41,9 @@ from collections import namedtuple
from
django.core.management.base
import
BaseCommand
,
CommandError
from
django.core.validators
import
validate_email
from
snf_django.lib.db.transaction
import
commit_on_success_strict
from
astakos.im.models
import
AstakosUser
,
AstakosUserQuota
,
Resource
from
astakos.im.functions
import
qh_sync
AddResourceArgs
=
namedtuple
(
'AddQuotaArgs'
,
(
'resource'
,
'capacity'
,
...
...
@@ -86,6 +88,7 @@ for a single user from the command line
help
=
"Do not ask for confirmation"
),
)
@
commit_on_success_strict
()
def
handle
(
self
,
*
args
,
**
options
):
from_file
=
options
[
'from_file'
]
set_capacity
=
options
[
'set_capacity'
]
...
...
@@ -165,6 +168,7 @@ for a single user from the command line
user
.
add_resource_policy
(
*
args
)
except
Exception
as
e
:
raise
CommandError
(
"Failed to add policy: %s"
%
e
)
qh_sync
([
user
.
id
])
def
import_from_file
(
self
,
location
):
try
:
...
...
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