mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-20 06:08:35 +02:00
wip: UI refactoring
* fixed an issue with the FETCH responses parser * Aliases are now displayed into *identities* * French translation update see #204
This commit is contained in:
+4
-2
@@ -10,11 +10,13 @@ class ModoboaException(Exception):
|
||||
pass
|
||||
|
||||
class PermDeniedException(ModoboaException):
|
||||
def __init__(self, msg):
|
||||
def __init__(self, msg=None):
|
||||
self.msg = msg
|
||||
|
||||
def __str__(self):
|
||||
return _("Permission denied: %s" % self.msg)
|
||||
if self.msg:
|
||||
return _("Permission denied: %s" % self.msg)
|
||||
return _("Permission denied")
|
||||
|
||||
class NeedsMailboxException(ModoboaException):
|
||||
pass
|
||||
|
||||
+3
-2
@@ -2,8 +2,9 @@
|
||||
from functools import wraps
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.utils.translation import ugettext as _
|
||||
from modoboa.admin.models import ObjectAccess
|
||||
from modoboa.admin.models import ObjectAccess, IntegrityError
|
||||
import events
|
||||
from exceptions import ModoboaException
|
||||
|
||||
def get_content_type(obj):
|
||||
"""Simple function that use the right method to retrieve a content type
|
||||
@@ -58,7 +59,7 @@ def grant_access_to_object(user, obj, is_owner=False):
|
||||
object_id=obj.id, is_owner=is_owner)
|
||||
objaccess.save()
|
||||
except IntegrityError, e:
|
||||
raise AdminError(_("Failed to grant access (%s)" % str(e)))
|
||||
raise ModoboaException(_("Failed to grant access (%s)" % str(e)))
|
||||
|
||||
def ungrant_access_to_object(obj, user=None):
|
||||
"""Ungrant access to an object for a specific user
|
||||
|
||||
Reference in New Issue
Block a user