Add --skip-errors option to migrate_to_database_settings command, allow any false/null value for 'off' in pendo setting.

This commit is contained in:
Chris Church
2016-09-28 09:58:19 -04:00
parent d76fd9b860
commit 0007ef2546
2 changed files with 67 additions and 30 deletions

View File

@@ -8,9 +8,18 @@ from django.utils.translation import ugettext_lazy as _
from awx.conf import fields, register
class PendoTrackingStateField(fields.ChoiceField):
def to_internal_value(self, data):
# Any false/null values get converted to 'off'.
if data in fields.NullBooleanField.FALSE_VALUES or data in fields.NullBooleanField.NULL_VALUES:
return 'off'
return super(PendoTrackingStateField, self).to_internal_value(data)
register(
'PENDO_TRACKING_STATE',
field_class=fields.ChoiceField,
field_class=PendoTrackingStateField,
choices=[
('off', _('Off')),
('anonymous', _('Anonymous')),