This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 8188962ca8f95828777a4b73b54e0817c9f24f9b
Author: Marcus Christie <[email protected]>
AuthorDate: Fri Jan 5 15:23:28 2018 -0500

    AIRAVATA-2598 Allow serializers to override default Thrift mapping
---
 django_airavata/apps/api/thrift_utils.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/django_airavata/apps/api/thrift_utils.py 
b/django_airavata/apps/api/thrift_utils.py
index e23671e..5bccf0e 100644
--- a/django_airavata/apps/api/thrift_utils.py
+++ b/django_airavata/apps/api/thrift_utils.py
@@ -35,7 +35,8 @@ def create_serializer_class(thrift_data_type):
         def __new__(cls, name, bases, attrs):
             thrift_spec = thrift_data_type.thrift_spec
             for field in thrift_spec:
-                if field:
+                # Don't replace existing attrs to allow subclasses to override
+                if field and field[2] not in attrs:
                     field_serializer = process_field(field)
                     attrs[field[2]] = field_serializer
             return super().__new__(cls, name, bases, attrs)

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to