Changes between Initial Version and Version 1 of Ticket #27039, comment 17


Ignore:
Timestamp:
Jun 1, 2017, 11:33:39 AM (7 years ago)
Author:
Matt Davis

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27039, comment 17

    initial v1  
    77The model form also has a clean method that if a value isn't supplied for field_x that it will generate one:
    88
    9 {{
     9{{{
    1010def clean_field_x(self):
    1111    token = self.cleaned_data.get('field_x')
     
    1313        token = utils.generate_token()
    1414    return token
    15 }}
     15}}}
    1616
    1717It would appear that in 1.10.1 it changed from using the generated token in the clean method, to then preferring the model field's default value.   I think this behavior is incorrect, shouldn't it prefer the form's cleaned data over the model defaults?
Back to Top