Fix broken transactions when generating a ticket.
Fix broken transactions when generating a ticket.

When we go to create a ticket, it is wrapped inside of
transaction.atomic. However, one can get a TransactionManagementError
exception that says: An error occurred in the current transaction. You
can't execute queries until the end of the 'atomic' block.

This exception is raised when an exception happens inside of an atomic
block, and is caught before a rollback of the outermost atomic block
occurs. Well, in this library, there is an atomic block, and this block
has a try: except: around that which would prevent the exception from
going up the stack and casing a rollback of the outermost atomic block.
So if code then wraps our get_ticket atomic block, the database is in a
state of needing a rollback.

Inside of Django, if the database doesn't support running transactions
in broken queries, the atomic_transaction property on the database is
set to False. In the case of MySQL, it is in fact set to False.

By reading the code in django/django@728548e, it looks like one can
recover from this state by marking the database as being rolled back. If
the database has atomic_transaction set to False, you can restart the
transaction by setting the rollback flag to False as seen in these
tests.

Fixes #6

streeter/django-ticketing