Skip to content
This repository has been archived by the owner on Feb 13, 2022. It is now read-only.

Feature/max length validation messages #107

Merged
merged 3 commits into from
Jul 23, 2018

Conversation

moh-moola
Copy link
Contributor

Add a 512 character limit for survey options

  • Added model choices validation to effectively be the default error shown in the admin
  • Also added front end validation as another safe guard for choice fields

@moh-moola moh-moola changed the title Feature/issue 820 max length validation messages Feature/max length validation messages Jul 11, 2018
@@ -63,6 +110,28 @@ def create_datetime_field(self, field, options):
def create_positive_number_field(self, field, options):
return forms.DecimalField(min_value=0, **options)

def create_dropdown_field(self, field, options):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need these here? Does this not already happen in wagtail surveys?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had to override to add return CharacterCountChoiceField(**options)

@moh-moola moh-moola merged commit 353f1d4 into develop Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants