Commit 7d25480c authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

Execute astakos-init and user-update in a transaction

parent d43a3021
......@@ -37,6 +37,7 @@ from optparse import make_option
from astakos.im.models import load_service_resources
from django.core.management.base import BaseCommand, CommandError
from synnefo.lib.db.transaction import commit_on_success_strict
import logging
logger = logging.getLogger(__name__)
......@@ -55,6 +56,7 @@ class Command(BaseCommand):
"on quotaholder")),
)
@commit_on_success_strict()
def handle(self, *args, **options):
if options['load']:
load_service_resources()
......@@ -44,6 +44,7 @@ from astakos.im.functions import (activate, deactivate,
set_pending_application_limit,
unset_pending_application_limit)
from ._common import remove_user_permission, add_user_permission
from synnefo.lib.db.transaction import commit_on_success_strict
class Command(BaseCommand):
......@@ -118,6 +119,7 @@ class Command(BaseCommand):
"project applications")),
)
@commit_on_success_strict()
def handle(self, *args, **options):
if len(args) != 1:
raise CommandError("Please provide a user ID")
......
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