mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-19 05:58:34 +02:00
@@ -67,21 +67,21 @@ class ModoboaAdminCommandTestCase(TestCase):
|
||||
self.workdir = tempfile.mkdtemp()
|
||||
|
||||
def tearDown(self):
|
||||
exec_cmd("rm -rf {}".format(self.workdir))
|
||||
exec_cmd("rm -rf {0}".format(self.workdir))
|
||||
|
||||
def _test_maps_generation(self, engine, categories=None):
|
||||
if categories is None:
|
||||
categories = ["std", "autoreply", "relaydomains"]
|
||||
dburl = "{}://user:password@localhost/testdb".format(engine)
|
||||
dburl = "{0}://user:password@localhost/testdb".format(engine)
|
||||
code, output = exec_cmd(
|
||||
"modoboa-admin.py postfix_maps --categories {} --dburl {} {}".format(
|
||||
"modoboa-admin.py postfix_maps --categories {0} --dburl {1} {2}".format(
|
||||
" ".join(categories), dburl, self.workdir
|
||||
)
|
||||
)
|
||||
self.assertEqual(code, 0)
|
||||
for category in categories:
|
||||
for mapfile in self.MAP_FILES[category]:
|
||||
path = "{}/{}".format(self.workdir, mapfile)
|
||||
path = "{0}/{1}".format(self.workdir, mapfile)
|
||||
self.assertTrue(os.path.exists(path))
|
||||
with open(path) as fpo:
|
||||
content = fpo.read()
|
||||
|
||||
@@ -236,7 +236,7 @@ def identity_modify_link(identity, active_tab='default'):
|
||||
def domadmin_actions(daid, domid):
|
||||
actions = [{
|
||||
"name": "removeperm",
|
||||
"url": "{}?domid={}&daid={}".format(
|
||||
"url": "{0}?domid={1}&daid={2}".format(
|
||||
reverse("admin:permission_remove"), domid, daid),
|
||||
"img": "fa fa-trash",
|
||||
"title": _("Remove this permission")
|
||||
|
||||
@@ -270,7 +270,7 @@ class ResellerTestCase(ResourceTestCase):
|
||||
self.clt.logout()
|
||||
self.clt.login(username='admin', password='password')
|
||||
self.ajax_get(
|
||||
"{}?domid={}&daid={}".format(
|
||||
"{0}?domid={1}&daid={2}".format(
|
||||
reverse('admin:permission_remove'), dom.id, self.user.id
|
||||
), {}
|
||||
)
|
||||
|
||||
@@ -40,7 +40,7 @@ def viewmail_menu(selection, folder, user, mail_id=None):
|
||||
{"name": "delete",
|
||||
"img": "fa fa-trash",
|
||||
"class": "btn-danger",
|
||||
"url": "{}?mbox={}&selection[]={}".format(
|
||||
"url": "{0}?mbox={1}&selection[]={2}".format(
|
||||
reverse("webmail:mail_delete"), folder, mail_id),
|
||||
"title": _("Delete")
|
||||
},
|
||||
@@ -100,11 +100,11 @@ def listmailbox_menu(selection, folder, user):
|
||||
"menu": [
|
||||
{"name": "mark-read",
|
||||
"label": _("Mark as read"),
|
||||
"url": "{}?status=read".format(
|
||||
"url": "{0}?status=read".format(
|
||||
reverse("webmail:mail_mark", args=[folder]))},
|
||||
{"name": "mark-unread",
|
||||
"label": _("Mark as unread"),
|
||||
"url": "{}?status=unread".format(
|
||||
"url": "{0}?status=unread".format(
|
||||
reverse("webmail:mail_mark", args=[folder]))},
|
||||
]
|
||||
},
|
||||
@@ -114,7 +114,8 @@ def listmailbox_menu(selection, folder, user):
|
||||
entries[1]["menu"] += [
|
||||
{"name": "empty",
|
||||
"label": _("Empty folder"),
|
||||
"url": "{}?name={}".format(reverse("webmail:trash_empty"), folder)}
|
||||
"url": "{0}?name={1}".format(
|
||||
reverse("webmail:trash_empty"), folder)}
|
||||
]
|
||||
return render_to_string('webmail/main_action_bar.html', {
|
||||
'selection': selection, 'entries': entries, 'user': user, 'css': "nav",
|
||||
|
||||
@@ -368,7 +368,7 @@ def listmailbox(request, defmailbox="INBOX", update_session=True):
|
||||
length = len(content)
|
||||
else:
|
||||
if page_id == 1:
|
||||
content = "<div class='alert alert-info'>{}</div>".format(
|
||||
content = "<div class='alert alert-info'>{0}</div>".format(
|
||||
_("Empty mailbox")
|
||||
)
|
||||
length = 0
|
||||
@@ -506,7 +506,7 @@ def viewmail(request):
|
||||
else:
|
||||
links = int(links)
|
||||
|
||||
url = "{}?mbox={}&mailid={}&links={}".format(
|
||||
url = "{0}?mbox={1}&mailid={2}&links={3}".format(
|
||||
reverse("webmail:mailcontent_get"), mbox, mailid, links)
|
||||
content = Template("""
|
||||
<iframe src="{{ url }}" id="mailcontent"></iframe>
|
||||
|
||||
Reference in New Issue
Block a user