from django import forms

from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES


class LandingPageForm(forms.Form):
    state = forms.ChoiceField(choices=STATES)
    preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
    second_candidate = forms.ChoiceField(choices=CANDIDATES_THIRD_PARTY)
    reason = forms.Textarea()

from django import forms

from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES


class LandingPageForm(forms.Form):
    state = forms.ChoiceField(choices=STATES)
    preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
    second_candidate = forms.ChoiceField(
        choices=CANDIDATES_THIRD_PARTY,
        required=False)
    reason = forms.Textarea()

Make second_candidate not required in sign up form
Make second_candidate not required in sign up form

  from django import forms
  
  from polling.models import CANDIDATES
  from polling.models import CANDIDATES_THIRD_PARTY
  from polling.models import STATES
  
  
  class LandingPageForm(forms.Form):
      state = forms.ChoiceField(choices=STATES)
      preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
-     second_candidate = forms.ChoiceField(choices=CANDIDATES_THIRD_PARTY)
+     second_candidate = forms.ChoiceField(
+         choices=CANDIDATES_THIRD_PARTY,
+         required=False)
      reason = forms.Textarea()
  
Make second_candidate not required in sign up form
## Code Before:
from django import forms

from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES


class LandingPageForm(forms.Form):
    state = forms.ChoiceField(choices=STATES)
    preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
    second_candidate = forms.ChoiceField(choices=CANDIDATES_THIRD_PARTY)
    reason = forms.Textarea()

## Instruction:
Make second_candidate not required in sign up form
## Code After:
from django import forms

from polling.models import CANDIDATES
from polling.models import CANDIDATES_THIRD_PARTY
from polling.models import STATES


class LandingPageForm(forms.Form):
    state = forms.ChoiceField(choices=STATES)
    preferred_candidate = forms.ChoiceField(choices=CANDIDATES)
    second_candidate = forms.ChoiceField(
        choices=CANDIDATES_THIRD_PARTY,
        required=False)
    reason = forms.Textarea()
