8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-23 03:43:12 +00:00

Utilisation du pseudo comme proposition par défaut DNS + Remplacement à la volée de l'underscore par un trait d'union

This commit is contained in:
Guillaume Goessel 2017-08-01 13:46:29 +02:00
parent 0401e3f4c2
commit 0a7c0731ad

View file

@ -90,7 +90,7 @@ def new_machine(request, userid):
machine = NewMachineForm(request.POST or None)
interface = AddInterfaceForm(request.POST or None, infra=request.user.has_perms(('infra',)))
nb_machine = Interface.objects.filter(machine__user=userid).count()
domain = DomainForm(request.POST or None, name_user=user.surname, nb_machine=nb_machine)
domain = DomainForm(request.POST or None, name_user=user.pseudo.replace('_','.'), nb_machine=nb_machine)
if machine.is_valid() and interface.is_valid():
new_machine = machine.save(commit=False)
new_machine.user = user