Skip to content

Commit

Permalink
Update access to user mailbox
Browse files Browse the repository at this point in the history
  • Loading branch information
tonioo committed Sep 28, 2015
1 parent 7536721 commit a4b9395
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modoboa_webmail/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class UserSettings(UserParametersForm):

@staticmethod
def has_access(user):
return user.mailbox_set.count() != 0
return hasattr(user, "mailbox")

def clean_mboxes_col_width(self):
"""Check if the entered value is a positive integer.
Expand Down
4 changes: 2 additions & 2 deletions modoboa_webmail/general_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def menu(target, user):
if target != "top_menu":
return []
if not user.mailbox_set.count():
if not hasattr(user, "mailbox"):
return []
return [
{"name": "webmail",
Expand All @@ -24,7 +24,7 @@ def userlogout(request):
from .lib import IMAPconnector
from .exceptions import ImapError

if not request.user.mailbox_set.count():
if not hasattr(request.user, "mailbox"):
return
try:
m = IMAPconnector(user=request.user.username,
Expand Down

0 comments on commit a4b9395

Please sign in to comment.