Update metaclass passing to work on Python 3
Fixes transformation labels in view titles. Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
3.3.4 (2019-12-XX)
|
3.3.4 (2019-12-XX)
|
||||||
==================
|
==================
|
||||||
- Update the gunicorn worker class to synchronous.
|
- 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)
|
3.3.3 (2019-12-05)
|
||||||
==================
|
==================
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class BaseTransformationType(type):
|
|||||||
return force_text(self.label)
|
return force_text(self.label)
|
||||||
|
|
||||||
|
|
||||||
class BaseTransformation(object):
|
class BaseTransformation(object, metaclass=BaseTransformationType):
|
||||||
"""
|
"""
|
||||||
Transformation can modify the appearance of the document's page preview.
|
Transformation can modify the appearance of the document's page preview.
|
||||||
Some transformation available are: Rotate, zoom, resize and crop.
|
Some transformation available are: Rotate, zoom, resize and crop.
|
||||||
@@ -27,6 +27,7 @@ class BaseTransformation(object):
|
|||||||
name = 'base_transformation'
|
name = 'base_transformation'
|
||||||
_layer_transformations = {}
|
_layer_transformations = {}
|
||||||
_registry = {}
|
_registry = {}
|
||||||
|
# PY 2
|
||||||
__metaclass__ = BaseTransformationType
|
__metaclass__ = BaseTransformationType
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class TransformationCreateView(
|
|||||||
'"%(transformation)s" for: %(object)s'
|
'"%(transformation)s" for: %(object)s'
|
||||||
) % {
|
) % {
|
||||||
'layer': self.layer,
|
'layer': self.layer,
|
||||||
'transformation': self.get_transformation_class().label,
|
'transformation': self.get_transformation_class(),
|
||||||
'object': self.external_object,
|
'object': self.external_object,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user