1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Add all settings to appsettings page & Convert settings choices

This commit is contained in:
catborise 2020-05-29 00:43:26 +03:00
parent e304a64a5c
commit e44b0d4df3
26 changed files with 417 additions and 439 deletions

View file

@ -2,14 +2,14 @@ import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.conf import settings
from appsettings.models import AppSettings
class UserAddForm(forms.Form):
name = forms.CharField(label="Name",
error_messages={'required': _('No User name has been entered')},
max_length=20)
password = forms.CharField(required=not settings.ALLOW_EMPTY_PASSWORD,
password = forms.CharField(required=False if AppSettings.objects.get(key="ALLOW_EMPTY_PASSWORD").value == 'True' else True,
error_messages={'required': _('No password has been entered')},)
def clean_name(self):