|
12 | 12 | from django.conf import settings
|
13 | 13 | from django.core import validators
|
14 | 14 | from django.core.exceptions import ImproperlyConfigured
|
15 |
| -from django.db import connection, models, transaction |
| 15 | +from django.db import models |
16 | 16 | from django.utils import six
|
17 | 17 | from django.views.generic import View
|
18 | 18 |
|
@@ -250,7 +250,7 @@ def md_filter_add_syntax_highlight(md):
|
250 | 250 |
|
251 | 251 | # pytz is required from Django 1.11. Remove when dropping Django 1.10 support.
|
252 | 252 | try:
|
253 |
| - import pytz # noqa |
| 253 | + import pytz # noqa |
254 | 254 | from pytz.exceptions import InvalidTimeError
|
255 | 255 | except ImportError:
|
256 | 256 | InvalidTimeError = Exception
|
@@ -297,23 +297,6 @@ class MaxLengthValidator(CustomValidatorMessage, validators.MaxLengthValidator):
|
297 | 297 | pass
|
298 | 298 |
|
299 | 299 |
|
300 |
| -def set_rollback(): |
301 |
| - if hasattr(transaction, 'set_rollback'): |
302 |
| - if connection.settings_dict.get('ATOMIC_REQUESTS', False): |
303 |
| - # If running in >=1.6 then mark a rollback as required, |
304 |
| - # and allow it to be handled by Django. |
305 |
| - if connection.in_atomic_block: |
306 |
| - transaction.set_rollback(True) |
307 |
| - elif transaction.is_managed(): |
308 |
| - # Otherwise handle it explicitly if in managed mode. |
309 |
| - if transaction.is_dirty(): |
310 |
| - transaction.rollback() |
311 |
| - transaction.leave_transaction_management() |
312 |
| - else: |
313 |
| - # transaction not managed |
314 |
| - pass |
315 |
| - |
316 |
| - |
317 | 300 | def authenticate(request=None, **credentials):
|
318 | 301 | from django.contrib.auth import authenticate
|
319 | 302 | if django.VERSION < (1, 11):
|
|
0 commit comments