Revision 321384f9
b/snf-astakos-app/astakos/im/management/commands/project-admin-checks.py | ||
---|---|---|
35 | 35 |
from django.core.management.base import BaseCommand, CommandError |
36 | 36 |
|
37 | 37 |
from astakos.im.functions import check_expiration |
38 |
from astakos.im.project_xctx import project_transaction_context |
|
38 |
from astakos.im.project_xctx import cmd_project_transaction_context
|
|
39 | 39 |
|
40 | 40 |
class Command(BaseCommand): |
41 | 41 |
help = "Perform administration checks on projects" |
... | ... | |
86 | 86 |
if options['expire']: |
87 | 87 |
self.expire(execute=execute) |
88 | 88 |
|
89 |
@project_transaction_context(sync=True) |
|
89 |
@cmd_project_transaction_context(sync=True)
|
|
90 | 90 |
def expire(self, execute=False, ctx=None): |
91 | 91 |
try: |
92 | 92 |
projects = check_expiration(execute=execute) |
b/snf-astakos-app/astakos/im/management/commands/project-application-approve.py | ||
---|---|---|
37 | 37 |
|
38 | 38 |
from astakos.im.models import ProjectApplication |
39 | 39 |
from astakos.im.functions import approve_application |
40 |
from astakos.im.project_xctx import project_transaction_context |
|
40 |
from astakos.im.project_xctx import cmd_project_transaction_context
|
|
41 | 41 |
|
42 | 42 |
class Command(BaseCommand): |
43 | 43 |
args = "<project application id>" |
... | ... | |
54 | 54 |
else: |
55 | 55 |
approve(id) |
56 | 56 |
|
57 |
@project_transaction_context(sync=True) |
|
57 |
@cmd_project_transaction_context(sync=True)
|
|
58 | 58 |
def approve(app, ctx=None): |
59 | 59 |
try: |
60 | 60 |
approve_application(app) |
b/snf-astakos-app/astakos/im/management/commands/project-update.py | ||
---|---|---|
35 | 35 |
|
36 | 36 |
from django.core.management.base import BaseCommand, CommandError |
37 | 37 |
from astakos.im.functions import terminate, suspend, resume |
38 |
from astakos.im.project_xctx import project_transaction_context |
|
38 |
from astakos.im.project_xctx import cmd_project_transaction_context
|
|
39 | 39 |
|
40 | 40 |
class Command(BaseCommand): |
41 | 41 |
args = "<project id>" |
... | ... | |
74 | 74 |
elif options['suspend']: |
75 | 75 |
run_command(suspend, id) |
76 | 76 |
|
77 |
@project_transaction_context(sync=True) |
|
77 |
@cmd_project_transaction_context(sync=True)
|
|
78 | 78 |
def run_command(func, id, ctx=None): |
79 | 79 |
try: |
80 | 80 |
func(id) |
b/snf-astakos-app/astakos/im/project_xctx.py | ||
---|---|---|
60 | 60 |
on_fail=project_error_view, |
61 | 61 |
**kwargs) |
62 | 62 |
|
63 |
def cmd_project_transaction_context(**kwargs): |
|
64 |
return RetryTransactionHandler(ctx=ProjectTransactionContext, |
|
65 |
**kwargs) |
|
66 |
|
|
63 | 67 |
class ProjectTransactionContext(NotificationTransactionContext): |
64 | 68 |
def __init__(self, sync=False, **kwargs): |
65 | 69 |
self._sync = sync |
Also available in: Unified diff