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:
tonio
2010-12-24 14:20:17 +01:00
parent 2c2b4a48fe
commit 5e16fc2d6b
13 changed files with 870 additions and 323 deletions
+2 -1
View File
@@ -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
View File
@@ -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)