8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-27 17:33:45 +00:00

Re match direct

This commit is contained in:
Gabriel Detraz 2018-12-28 23:23:05 +01:00 committed by root
parent bfd79d44eb
commit e076c1da33

View file

@ -1070,7 +1070,7 @@ class Adherent(User):
"""Validate from raw entry if is it a valid gpg fp""" """Validate from raw entry if is it a valid gpg fp"""
if self.gpg_fingerprint: if self.gpg_fingerprint:
gpg_fingerprint = self.gpg_fingerprint.replace(' ', '').upper() gpg_fingerprint = self.gpg_fingerprint.replace(' ', '').upper()
if not re.compile("^[0-9A-F]{40}$").match(gpg_fingerprint): if not re.match("^[0-9A-F]{40}$", gpg_fingerprint):
raise ValidationError(_("A gpg fingerprint must contain 40 hexadecimal carracters")) raise ValidationError(_("A gpg fingerprint must contain 40 hexadecimal carracters"))
self.gpg_fingerprint = gpg_fingerprint self.gpg_fingerprint = gpg_fingerprint