mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-11-16 09:34:03 +01:00
@@ -28,7 +28,7 @@ class ForwardForm(forms.Form):
|
||||
recipients = []
|
||||
rawdata = self.cleaned_data["dest"].strip()
|
||||
if not rawdata:
|
||||
return
|
||||
return recipients
|
||||
for rcpt in rawdata.split(","):
|
||||
local_part, domname = split_mailbox(rcpt)
|
||||
if not local_part or not domname:
|
||||
|
||||
@@ -22,8 +22,8 @@ class DomainManager(Manager):
|
||||
to fill ``ModelChoiceField`` objects.
|
||||
"""
|
||||
if admin.is_superuser:
|
||||
return self.get_query_set()
|
||||
return self.get_query_set().filter(owners__user=admin)
|
||||
return self.get_queryset()
|
||||
return self.get_queryset().filter(owners__user=admin)
|
||||
|
||||
|
||||
class Domain(AdminObject):
|
||||
|
||||
@@ -66,7 +66,7 @@ class MailboxManager(Manager):
|
||||
qf = Q(pk__in=ids) & qf
|
||||
else:
|
||||
qf = Q(pk__in=ids)
|
||||
return self.get_query_set().select_related().filter(qf)
|
||||
return self.get_queryset().select_related().filter(qf)
|
||||
|
||||
|
||||
class Mailbox(AdminObject):
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
"""SimpleUsers views."""
|
||||
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.utils.translation import ugettext as _
|
||||
@@ -38,9 +39,9 @@ def forward(request, tplname="admin/forward.html"):
|
||||
)
|
||||
|
||||
form = ForwardForm()
|
||||
if al is not None:
|
||||
if al is not None and al.recipients:
|
||||
form.fields["dest"].initial = al.recipients
|
||||
if al.aliasrecipient_set.filter(mailbox=mb.id).exists():
|
||||
if al.aliasrecipient_set.filter(r_mailbox=mb.pk).exists():
|
||||
form.fields["keepcopies"].initial = True
|
||||
return render_to_json_response({
|
||||
"content": _render_to_string(request, tplname, {
|
||||
|
||||
Reference in New Issue
Block a user