mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-28 06:28:43 +01:00
see #78
At last something that works pretty well under firefox and with multiple selection possible (using Mootools HtmlTable.Select). There are some problems with IE and Chrome (the position: relative on td elements is not well supported). Mootools update (1.3) close #109 Checking limit when creating/updating a mailbox.
This commit is contained in:
+2
-1
@@ -53,7 +53,8 @@ class MailboxForm(forms.ModelForm):
|
||||
m = super(MailboxForm, self).save(commit=False)
|
||||
if commit:
|
||||
m.save(enabled=self.cleaned_data["enabled"],
|
||||
password=self.cleaned_data["password1"])
|
||||
password=self.cleaned_data["password1"],
|
||||
quota=self.cleaned_data["quota"])
|
||||
return m
|
||||
|
||||
class AliasForm(forms.ModelForm):
|
||||
|
||||
+6
-5
@@ -91,10 +91,9 @@ class Mailbox(models.Model):
|
||||
quota = models.IntegerField()
|
||||
uid = models.IntegerField()
|
||||
gid = models.IntegerField()
|
||||
path = models.CharField(max_length=200)
|
||||
path = models.CharField(max_length=255)
|
||||
domain = models.ForeignKey(Domain)
|
||||
user = models.ForeignKey(User)
|
||||
path = models.CharField(max_length=255)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
@@ -173,12 +172,14 @@ class Mailbox(models.Model):
|
||||
self.password = crypt_password(kwargs["password"])
|
||||
self.uid = pwd.getpwnam(parameters.get_admin("VIRTUAL_UID")).pw_uid
|
||||
self.gid = pwd.getpwnam(parameters.get_admin("VIRTUAL_GID")).pw_gid
|
||||
if not self.quota:
|
||||
if kwargs.has_key("quota") and int(kwargs["quota"]) < self.domain.quota:
|
||||
self.quota = kwargs["quota"]
|
||||
else:
|
||||
self.quota = self.domain.quota
|
||||
self.full_address = self.user.email
|
||||
try:
|
||||
del kwargs["enabled"]
|
||||
del kwargs["password"]
|
||||
for kw in ["enabled", "password", "quota"]:
|
||||
del kwargs[kw]
|
||||
except KeyError:
|
||||
pass
|
||||
super(Mailbox, self).save(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user