mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-02 12:13:54 +01:00
fixed #107
Removed useless fields (full_address) and added associated migrations. SQL queries used by postfix or dovecot will need to be updated. (as the documentation) see #103 Big refactoring of objects creation and edition. (javascript cleanup, forms factoring, etc.)
This commit is contained in:
@@ -40,10 +40,10 @@ class WMtable(tables.Table):
|
||||
|
||||
class EmailAddress(object):
|
||||
addr_exp = re.compile("([^<\(]+)[<(]([^>)]+)[>)]")
|
||||
name_exp = re.compile('"([^"]+)"')
|
||||
name_exp = re.compile('"?([^"]+)"?')
|
||||
|
||||
def __init__(self, address):
|
||||
self.fulladdress = address
|
||||
self.fulladdress = u2u_decode.u2u_decode(address).strip("\r\t\n")
|
||||
self.name = self.address = None
|
||||
m = EmailAddress.addr_exp.match(self.fulladdress)
|
||||
if m is None:
|
||||
@@ -75,7 +75,7 @@ class IMAPheader(object):
|
||||
addr = EmailAddress(value)
|
||||
if "full" in kwargs.keys() and kwargs["full"]:
|
||||
return addr.fulladdress
|
||||
return addr.name and addr.name or value
|
||||
return addr.name and addr.name or addr.fulladdress
|
||||
|
||||
@staticmethod
|
||||
def parse_address_list(values, **kwargs):
|
||||
@@ -454,11 +454,12 @@ class ImapEmail(Email):
|
||||
def render_headers(self, **kwargs):
|
||||
from django.template.loader import render_to_string
|
||||
|
||||
return render_to_string("webmail/headers.html", {
|
||||
res = render_to_string("webmail/headers.html", {
|
||||
"headers" : self.headers,
|
||||
"folder" : kwargs["folder"], "mail_id" : kwargs["mail_id"],
|
||||
"attachments" : self.attachments != {} and self.attachments or None
|
||||
})
|
||||
return res
|
||||
|
||||
class ReplyModifier(ImapEmail):
|
||||
def __init__(self, msg, user, form, all=False, **kwargs):
|
||||
|
||||
@@ -154,7 +154,6 @@
|
||||
var rtimer = null;
|
||||
|
||||
window.addEvent("pageRefresh", function() {
|
||||
console.log("timer : ", rtimer);
|
||||
if (rtimer) {
|
||||
clearInterval(rtimer);
|
||||
rtimer = null;
|
||||
|
||||
Reference in New Issue
Block a user