Code

Opened 6 years ago

Closed 6 years ago

#6790 closed (wontfix)

Changes to form.errors adressing #6705 and #6138

Reported by: oyvind Owned by: nobody
Component: Forms Version: master
Severity: Keywords: override error_list error_dict show labels errors
Cc: oyvind.saltvik@… Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Make it possible to override error_dict.

Makes sure all parts uses the overridden error_list and error_class.

{{ form.errors }} now shows label instead of key if it exists in as_ul and as_text

Attachments (4)

error_dict_list_fixes_and_overrides.diff (7.2 KB) - added by oyvind 6 years ago.
error_dict_list_fixes_and_overrides_2.diff (7.2 KB) - added by oyvind 6 years ago.
no need for force_unicode and escape
error_dict_list_fixes_and_overrides_3.diff (7.1 KB) - added by oyvind 6 years ago.
Removed some code duplication one form.errors.get
error_dict_list_fixes_and_overrides_4.diff (6.5 KB) - added by oyvind 6 years ago.
Fix one thing at the time, just overrides and no labels in errordict

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by oyvind

comment:1 Changed 6 years ago by oyvind

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Changed 6 years ago by oyvind

no need for force_unicode and escape

comment:2 Changed 6 years ago by SmileyChris

  • Needs tests set
  • Triage Stage changed from Unreviewed to Accepted

Note, this is backwards incompatible (error_class attribute becomes error_list)

comment:3 Changed 6 years ago by SmileyChris

  • Keywords easy-pickings added

The easy picking is adding tests. Go!

Changed 6 years ago by oyvind

Removed some code duplication one form.errors.get

Changed 6 years ago by oyvind

Fix one thing at the time, just overrides and no labels in errordict

comment:4 Changed 6 years ago by oyvind

Labels in ErrorDict should be solved better, perhaps a name-to-label dictionary passed to ErrorDict.

Should make this a new ticket.

comment:5 Changed 6 years ago by SmileyChris

  • Keywords easy-pickings removed
  • Needs tests unset
  • Triage Stage changed from Accepted to Design decision needed

Note that this is still backwards incompatible (maybe in a more confusing way), error_class was previously expected to be an ErrorList, now it should be an ErrorDict.

The tests are good enough now, since we aren't introducing new functionality (just modifying it).

Thinking more about this, tt should probably go back for a design decision, so I'll push it back there now.

comment:6 Changed 6 years ago by oyvind

  • Resolution set to wontfix
  • Status changed from new to closed

removed in favor or rendering errors via filters

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.