Hi,

I'm overriding save_formset in a subclass of ModelAdmin.  This worked fine 
using svn 9382, but I've just updated to svn 10674 and it's not working.

def save_formset(self, request, form, formset, change):
        """
        Stamp the model as last changed by the current user
        Set the owner to the current user if it is a blank field
        """
        instances = formset.save(commit=False)
        for instance in instances:
            instance.lastChangedBy = request.user
            try:
                instance = obj.owner
            except:
                instance.owner = request.user
            instance.save()
        formset.save()

In the above code, instances = formset.save(commit=False) appears to be saving 
my instance to the database, and I'm getting 

IntegrityError: null value in column "lastChangedBy_id" violates not-null 
constraint

because I haven't had chance to set it yet.

Can anyone give me any clues?

Cheers,

Tim..

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to