prepare for authentic changing serialization methods

This commit is contained in:
Frédéric Péters 2017-03-27 10:28:29 +02:00
parent 52abb3bac8
commit 22b4d574a1
2 changed files with 14 additions and 1 deletions

1
debian/control vendored
View File

@ -11,6 +11,5 @@ Package: python-authentic2-auth-fedict
Architecture: all Architecture: all
Depends: ${misc:Depends}, Depends: ${misc:Depends},
python-authentic2 (>= 2.1.20.1054) python-authentic2 (>= 2.1.20.1054)
Conflicts: python-authentic2 (> 2.1.20.1137)
Description: Fedict authentication frontend for Authentic2 Description: Fedict authentication frontend for Authentic2

View File

@ -14,6 +14,8 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import json
import django.apps import django.apps
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.signals import user_logged_in from django.contrib.auth.signals import user_logged_in
@ -63,20 +65,32 @@ class Plugin(object):
return [ return [
{'label': _('National Register Number'), {'label': _('National Register Number'),
'name': 'nrn', 'name': 'nrn',
'serialize': json.dumps,
'deserialize': json.loads,
'field_class': fields.NrnField, }, 'field_class': fields.NrnField, },
{'label': _('Date'), {'label': _('Date'),
'serialize': json.dumps,
'deserialize': json.loads,
'name': 'date', 'name': 'date',
'field_class': fields.DateField, }, 'field_class': fields.DateField, },
{'label': _('Street'), {'label': _('Street'),
'serialize': json.dumps,
'deserialize': json.loads,
'name': 'street', 'name': 'street',
'field_class': fields.StreetField, }, 'field_class': fields.StreetField, },
{'label': _('House number'), {'label': _('House number'),
'serialize': json.dumps,
'deserialize': json.loads,
'name': 'num_house', 'name': 'num_house',
'field_class': fields.NumHouseField, }, 'field_class': fields.NumHouseField, },
{'label': _('Phone number'), {'label': _('Phone number'),
'serialize': json.dumps,
'deserialize': json.loads,
'name': 'phone', 'name': 'phone',
'field_class': fields.NumPhoneField, }, 'field_class': fields.NumPhoneField, },
{'label': _('Country'), {'label': _('Country'),
'serialize': json.dumps,
'deserialize': json.loads,
'name': 'country', 'name': 'country',
'field_class': fields.CountryField, }, 'field_class': fields.CountryField, },
] ]