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:
Antoine Nguyen
2012-05-03 11:31:02 +02:00
parent 114b40d3c0
commit bd126b507f
23 changed files with 1247 additions and 941 deletions
+4 -2
View File
@@ -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
View File
@@ -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