Skip to content

Commit

Permalink
Merge pull request #16 from seawolf42/fix/no-serializer-field-reset-d…
Browse files Browse the repository at this point in the history
…uring-management-commands

Fix/no serializer field reset during management commands
  • Loading branch information
seawolf42 committed Jun 14, 2018
2 parents 8bf6da8 + 2c38143 commit ebbbf60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions lookup_tables/drf_fields.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import sys

from lookup_tables.models import LookupTableItem
from rest_framework import fields
import six

from django.conf import settings


_IGNORE_INIT_RESET = getattr(settings, 'LOOKUP_TABLES_DRF_FIELD_INIT_NO_RESET', False)
if sys.argv[0].endswith('manage.py') and 'runserver' not in sys.argv:
_IGNORE_INIT_RESET = True
else:
_IGNORE_INIT_RESET = getattr(settings, 'LOOKUP_TABLES_DRF_FIELD_INIT_NO_RESET', False)


class LookupTableItemSerializerField(fields.ChoiceField):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

setup(
name='django-lookup-tables',
version='0.12.1',
version='0.12.2',
packages=find_packages(),
include_package_data=True,
license='MIT License',
Expand Down

0 comments on commit ebbbf60

Please sign in to comment.