airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata-django-portal] 01/02: AIRAVATA-2598 Allow serializers to override default Thrift mapping
Date Tue, 09 Jan 2018 14:49:35 GMT
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 <machrist@iu.edu>
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
"commits@airavata.apache.org" <commits@airavata.apache.org>.

Mime
View raw message