handle native authentic birthdate field
This commit is contained in:
parent
f9d0087fa8
commit
b53a421dbb
|
@ -14,6 +14,7 @@
|
|||
# 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/>.
|
||||
|
||||
import datetime
|
||||
import logging
|
||||
import requests
|
||||
|
||||
|
@ -147,8 +148,13 @@ class AuthenticAdapter(DefaultAdapter):
|
|||
birthdate = '%s/%s/20%s' % (nrn[4:6], nrn[2:4], nrn[:2])
|
||||
else:
|
||||
birthdate = ''
|
||||
Attribute.objects.get(name='birthdate').set_value(user, birthdate,
|
||||
verified=True)
|
||||
try:
|
||||
Attribute.objects.get(name='birthdate').set_value(user, birthdate,
|
||||
verified=True)
|
||||
except AttributeError: # native authentic date field
|
||||
birthdate = datetime.datetime.strptime(birthdate, '%d/%m/%Y').date()
|
||||
Attribute.objects.get(name='birthdate').set_value(user, birthdate,
|
||||
verified=True)
|
||||
if int(nrn[6:9]) % 2:
|
||||
title = 'Monsieur'
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue