Do not try to fetch the mailbox associated to an alias if this last one is not defined!

see #178
This commit is contained in:
Antoine Nguyen
2011-12-26 15:31:20 +01:00
parent 680862c778
commit 88fc62f89c
+6 -6
View File
@@ -78,12 +78,12 @@ def setforward(request, tplname="userprefs/setforward.html"):
form = ForwardForm()
if al is not None:
form.fields["dest"].initial = al.extmboxes
try:
selfmb = al.mboxes.get(pk=mb.id)
except Mailbox.DoesNotExist:
pass
else:
form.fields["keepcopies"].initial = True
try:
selfmb = al.mboxes.get(pk=mb.id)
except Mailbox.DoesNotExist:
pass
else:
form.fields["keepcopies"].initial = True
return _render(request, tplname, {
"form" : form
})