add use_required_attribute=False to prevent required attribute from being added to html (maintaining original behavior)

This commit is contained in:
jmath1 2020-06-11 11:45:50 -04:00
parent 5c6a48ed52
commit 184348e436
3 changed files with 8 additions and 0 deletions

View file

@ -94,6 +94,7 @@ class ForgotPasswordReturnForm(forms.Form):
required=False)
class AccountSettingsForm(forms.Form):
use_required_attribute = False
username = forms.RegexField(regex=r'^\w+$',
max_length=30,
widget=forms.TextInput(attrs={'class': 'NB-input'}),
@ -192,6 +193,7 @@ class AccountSettingsForm(forms.Form):
MCustomStyling.save_user(self.user.pk, custom_css, custom_js)
class RedeemCodeForm(forms.Form):
use_required_attribute = False
gift_code = forms.CharField(widget=forms.TextInput(),
label="Gift code",
required=True)

View file

@ -76,6 +76,8 @@ class LoginForm(forms.Form):
class SignupForm(forms.Form):
use_required_attribute = False
username = forms.RegexField(regex=r'^\w+$',
max_length=30,
widget=forms.TextInput(attrs={'class': 'NB-input'}),
@ -172,6 +174,8 @@ class SignupForm(forms.Form):
return new_user
class FeatureForm(forms.Form):
use_required_attribute = False
description = forms.CharField(required=True)
def save(self):

View file

@ -12,6 +12,8 @@ class MonospaceForm(forms.Form):
class CardForm(MonospaceForm):
use_required_attribute = False
last_4_digits = forms.CharField(required=True, min_length=4, max_length=4,
widget=forms.HiddenInput())
stripe_token = forms.CharField(required=True, widget=forms.HiddenInput())