Commit 1cdd2d44 authored by chirac's avatar chirac
Browse files

Fix linux user validator

parent 416cf0af
......@@ -16,11 +16,11 @@ from django.utils import timezone
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
def linux_user_check(login):
def linux_user_validator(login):
""" Validation du pseudo pour respecter les contraintes unix"""
UNIX_LOGIN_PATTERN = re.compile("^[a-z_][a-z0-9_-]*[$]?$")
if not UNIX_LOGIN_PATTERN.match(login):
raise forms.ValidationError("Ce login n'est pas valide")
raise forms.ValidationError("Ce login n'est pas valide et contient des carractères interdits")
return
def mailalias_check(alias):
......@@ -30,14 +30,6 @@ def mailalias_check(alias):
raise forms.ValidationError("Cet alias n'est pas valide")
return
def linux_user_validator(login):
if not linux_user_check(login):
raise forms.ValidationError(
", ce pseudo ('%(label)s') contient des carractères interdits",
params={'label': login},
)
def get_admin_right():
try:
admin_right = ListRight.objects.get(listright="admin")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment