Re: IntegrityError exception not caught by Django

2010-06-14 Thread felix
thanks again anssi, stellar reply I might do this below. the tracking is the last thing to happen before rendering, so there are no more UPDATE or INSERTS and in most cases views that use tracking don't do anything but select anyway but OTOH I'm already running rabbit and celery so I might mess

Re: IntegrityError exception not caught by Django

2010-06-14 Thread akaariai
On Jun 14, 1:24 am, felix wrote: > brilliant, you are correct: > > Foreign-key constraints: >     "traffic_tracking2010_content_type_id_fkey" FOREIGN KEY > (content_type_id) REFERENCES django_content_type(id) DEFERRABLE > INITIALLY DEFERRED >     "traffic_tracking2010_src_content_type_id_fkey" FOR

Re: IntegrityError exception not caught by Django

2010-06-13 Thread felix
brilliant, you are correct: Foreign-key constraints: "traffic_tracking2010_content_type_id_fkey" FOREIGN KEY (content_type_id) REFERENCES django_content_type(id) DEFERRABLE INITIALLY DEFERRED "traffic_tracking2010_src_content_type_id_fkey" FOREIGN KEY (src_content_type_id) REFERENCES djan

Re: IntegrityError exception not caught by Django

2010-06-13 Thread akaariai
> Can anybody figure out why the IntegrityError doesn't get thrown till > then ? > Why didn't Django catch errors thrown in middleware ? Most likely the foreign keys are defined as "deferrable initially deferred", meaning that the database doesn't check them before commit. And this of course mean

IntegrityError exception not caught by Django

2010-06-13 Thread felix
In the process of serving a view I am saving a record that an incoming URL specified a tracking ID. One of the URLs got mangled by somebody somewhere resulting in it being decoded as a non-existent user ID. # I would expect this to throw an integrity error tracking.save() but it doesn't