mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-04 12:24:09 +01:00
@@ -25,10 +25,11 @@ class Command(BaseCommand):
|
|||||||
if not os.path.exists(operation.argument):
|
if not os.path.exists(operation.argument):
|
||||||
return
|
return
|
||||||
new_mail_home = operation.mailbox.mail_home
|
new_mail_home = operation.mailbox.mail_home
|
||||||
try:
|
if not os.path.exists(new_mail_home):
|
||||||
os.makedirs(os.path.dirname(new_mail_home))
|
try:
|
||||||
except os.error as e:
|
os.makedirs(os.path.dirname(new_mail_home))
|
||||||
raise OperationError(str(e))
|
except os.error as e:
|
||||||
|
raise OperationError(str(e))
|
||||||
code, output = exec_cmd(
|
code, output = exec_cmd(
|
||||||
"mv %s %s" % (ope.argument, new_mail_home)
|
"mv %s %s" % (ope.argument, new_mail_home)
|
||||||
)
|
)
|
||||||
@@ -56,7 +57,7 @@ class Command(BaseCommand):
|
|||||||
try:
|
try:
|
||||||
f(ope)
|
f(ope)
|
||||||
except (OperationError, AdminError) as e:
|
except (OperationError, AdminError) as e:
|
||||||
self.logger.critical('Operation failed: %s. Reason: %s', ope, str(e))
|
self.logger.critical('%s failed (reason: %s)', ope, e)
|
||||||
else:
|
else:
|
||||||
self.logger.info('Operation succeed: %s', ope)
|
self.logger.info('%s succeed', ope)
|
||||||
ope.delete()
|
ope.delete()
|
||||||
|
|||||||
@@ -1028,7 +1028,7 @@ class MailboxOperation(models.Model):
|
|||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.type == 'rename':
|
if self.type == 'rename':
|
||||||
return 'Rename %s -> %s' % (self.argument, self.mailbox.full_address)
|
return 'Rename %s -> %s' % (self.argument, self.mailbox.mail_home)
|
||||||
return 'Delete %s' % self.argument
|
return 'Delete %s' % self.argument
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user