Commit d2e16c8d authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

Change helper function to allow multiple arguments

parent 954dc9bc
......@@ -109,14 +109,14 @@ class Command(BaseCommand):
if options['terminate_expired']:
self.expire(execute=True)
@cmd_project_transaction_context(sync=True)
def run_command(self, func, id, ctx=None):
try:
func(id)
except BaseException as e:
if ctx:
ctx.mark_rollback()
raise CommandError(e)
def run_command(self, func, *args):
with cmd_project_transaction_context(sync=True) as ctx:
try:
func(*args)
except BaseException as e:
if ctx:
ctx.mark_rollback()
raise CommandError(e)
def print_expired(self, projects, execute):
length = len(projects)
......
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