cfpb/django-nudge — pull request #43 by jaap3 (2012-11-07 16:47:54+00:00)
Title: Handele exceptions more graceful.

Here's some things I fixed after setting up nudge for the first time and having some configuration issues.

This handles a few cases more gracefully:

* wrapping send_command in a try catch, this makes a misconfigured endpoints a bit easier to identify.
* push_one now catches the exception raised by send_command, so pushing to a misconfigured endpoint actually marks the batch as failed.
* process_batch had mixed tabs and spaces, checked a magic number and did a weird type check. Hopefully cleaned that up correctly.
* Handle a misconfigured NUDGE_SELECTIVE setting a bit more graceful, by catching ContentType.DoesNotExist and making sure all lookup values are lowercased.

Also cleans up the code of the methods I touched a bit. There were mixed tabs and spaces for example, could do a pep8 cleanup of the entire codebase if that's appreciated.