Fix crash in dashboard: mimetype has been removed

mimetype parameter has been renamed to content_type in Django 1.5, and removed
in 1.7

Change-Id: Iae4a34a7a37841767c03c08d308f8b3b1d9ed63e
(cherry picked from commit 326a7249087388128c36a40d18563098e847df9f)
Handle the lava-health check inside an atomic check

Queries in exception handlers in migrations need to
isolate the query to ensure a correct rollback.

Change-Id: Id34b5ba44933cd2b33a3bd193d5efb80e2f37b71
(cherry picked from commit e84249e3d53f1d16aa4c6eb64ac8de728bc9c033)