﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
12553	"unexpected admin behavior for field when submitting ""blank"" and altering in model.save()"	pragmar	Honza Král	"Today updated from trunk revision 12007 to 1.2 alpha (r12114) and discovered an oddity in the admin - the behavior disappeared after reverting back to 12007 with no other changes applied. 

Here's the basic setup:

There's a model with a DateTimeField named ""publish"" and blank set to True. I've implemented without auto_now_add, but the intended behavior is similar as there's a save method that looks to populate if it is submitted blank. To lend some perspective, the reason it is set up in this manner is to allow a simple admin ui (it's tucked into an advanced collapsible) while maintaining the potential to publish to the future.

{{{
class Post(KeenerBase):
    publish = models.DateTimeField('publish',blank=True)
    ...
    def save(self, *args, **kwargs):
        if not self.publish:
            self.publish = datetime.datetime.utcnow()
        super(Post, self).save(*args, **kwargs)
}}}

Under 12007 a blank publish field falls through to the Post.save(), adds the datetime and validates. Under 1.2 alpha it does not validate and doesn't appear to hit the save method. The admin validation states the field can not be null. The release notes didn't mention anything regarding model changes to that effect, so I beleive I may've hit a bug.
"		closed	contrib.admin	1.2-alpha		fixed	model, save, blank, not null		Design decision needed	0	0	0	0	0	0
