From 22b4d574a13996beca04bfcff5ae4f7fcede8b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 27 Mar 2017 10:28:29 +0200 Subject: [PATCH] prepare for authentic changing serialization methods --- debian/control | 1 - src/authentic2_auth_fedict/__init__.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 218de93..81762a9 100644 --- a/debian/control +++ b/debian/control @@ -11,6 +11,5 @@ Package: python-authentic2-auth-fedict Architecture: all Depends: ${misc:Depends}, python-authentic2 (>= 2.1.20.1054) -Conflicts: python-authentic2 (> 2.1.20.1137) Description: Fedict authentication frontend for Authentic2 diff --git a/src/authentic2_auth_fedict/__init__.py b/src/authentic2_auth_fedict/__init__.py index 216f6e9..edfdbe4 100644 --- a/src/authentic2_auth_fedict/__init__.py +++ b/src/authentic2_auth_fedict/__init__.py @@ -14,6 +14,8 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . +import json + import django.apps from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.signals import user_logged_in @@ -63,20 +65,32 @@ class Plugin(object): return [ {'label': _('National Register Number'), 'name': 'nrn', + 'serialize': json.dumps, + 'deserialize': json.loads, 'field_class': fields.NrnField, }, {'label': _('Date'), + 'serialize': json.dumps, + 'deserialize': json.loads, 'name': 'date', 'field_class': fields.DateField, }, {'label': _('Street'), + 'serialize': json.dumps, + 'deserialize': json.loads, 'name': 'street', 'field_class': fields.StreetField, }, {'label': _('House number'), + 'serialize': json.dumps, + 'deserialize': json.loads, 'name': 'num_house', 'field_class': fields.NumHouseField, }, {'label': _('Phone number'), + 'serialize': json.dumps, + 'deserialize': json.loads, 'name': 'phone', 'field_class': fields.NumPhoneField, }, {'label': _('Country'), + 'serialize': json.dumps, + 'deserialize': json.loads, 'name': 'country', 'field_class': fields.CountryField, }, ]