diff --git a/HISTORY.rst b/HISTORY.rst index 5253009789..3a76214bf1 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,7 +1,8 @@ 3.3.4 (2019-12-XX) ================== - Update the gunicorn worker class to synchronous. - +- Update the way the BaseTransformationType metaclass is passed + to work on Python 3. 3.3.3 (2019-12-05) ================== diff --git a/mayan/apps/converter/transformations.py b/mayan/apps/converter/transformations.py index 4c02599615..f2c4b1cee5 100644 --- a/mayan/apps/converter/transformations.py +++ b/mayan/apps/converter/transformations.py @@ -18,7 +18,7 @@ class BaseTransformationType(type): return force_text(self.label) -class BaseTransformation(object): +class BaseTransformation(object, metaclass=BaseTransformationType): """ Transformation can modify the appearance of the document's page preview. Some transformation available are: Rotate, zoom, resize and crop. @@ -27,6 +27,7 @@ class BaseTransformation(object): name = 'base_transformation' _layer_transformations = {} _registry = {} + # PY 2 __metaclass__ = BaseTransformationType @staticmethod diff --git a/mayan/apps/converter/views.py b/mayan/apps/converter/views.py index 7633a508c2..f03e7a576f 100644 --- a/mayan/apps/converter/views.py +++ b/mayan/apps/converter/views.py @@ -80,7 +80,7 @@ class TransformationCreateView( '"%(transformation)s" for: %(object)s' ) % { 'layer': self.layer, - 'transformation': self.get_transformation_class().label, + 'transformation': self.get_transformation_class(), 'object': self.external_object, } }