Skip to content
Snippets Groups Projects
Commit ecfe0a44 authored by Branson Craig Stephens's avatar Branson Craig Stephens
Browse files

Fixed userprofile forms to allow blank far threshold. You have to set...

Fixed userprofile forms to allow blank far threshold. You have to set blank=True,null=True on the model field *and* required=False on the form field.
parent a280376f
No related branches found
No related tags found
No related merge requests found
from django import forms from django import forms
from django.db import models
from models import Trigger, Contact from models import Trigger, Contact
from django.forms.models import modelformset_factory
def triggerFormFactory(postdata=None, user=None): def triggerFormFactory(postdata=None, user=None):
class TF(forms.ModelForm): class TF(forms.ModelForm):
farThresh = forms.FloatField(label='FAR Threshold (Hz)', farThresh = forms.FloatField(label='FAR Threshold (Hz)', required=False,
help_text="Leave blank to recieve all events, regardless of FAR.") help_text="Leave blank to recieve all events, regardless of FAR.")
class Meta: class Meta:
model = Trigger model = Trigger
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment