Decorator helper that overrides django atomic decorator and automatically adds create revision.

def atomic(func):
    """
    Decorator helper that overrides django atomic decorator and automatically adds create revision.
    """
    try:
        from reversion.revisions import create_revision

        return transaction.atomic(create_revision()(func))
    except ImportError:
        return transaction.atomic(func)