mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
Merge pull request #90 from ryanpetrello/fix-7320
fix a few activity stream bugs related to setting creation/update
This commit is contained in:
commit
53700c10b9
@ -65,6 +65,8 @@ class Setting(CreatedModifiedModel):
|
|||||||
# After saving a new instance for the first time, set the encrypted
|
# After saving a new instance for the first time, set the encrypted
|
||||||
# field and save again.
|
# field and save again.
|
||||||
if encrypted and new_instance:
|
if encrypted and new_instance:
|
||||||
|
from awx.main.signals import disable_activity_stream
|
||||||
|
with disable_activity_stream():
|
||||||
self.value = self._saved_value
|
self.value = self._saved_value
|
||||||
self.save(update_fields=['value'])
|
self.save(update_fields=['value'])
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import urlparse
|
|||||||
import threading
|
import threading
|
||||||
import contextlib
|
import contextlib
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import six
|
||||||
|
|
||||||
# Decorator
|
# Decorator
|
||||||
from decorator import decorator
|
from decorator import decorator
|
||||||
@ -325,7 +326,10 @@ def _convert_model_field_for_display(obj, field_name, password_fields=None):
|
|||||||
return '<missing {}>-{}'.format(obj._meta.verbose_name, getattr(obj, '{}_id'.format(field_name)))
|
return '<missing {}>-{}'.format(obj._meta.verbose_name, getattr(obj, '{}_id'.format(field_name)))
|
||||||
if password_fields is None:
|
if password_fields is None:
|
||||||
password_fields = set(getattr(type(obj), 'PASSWORD_FIELDS', [])) | set(['password'])
|
password_fields = set(getattr(type(obj), 'PASSWORD_FIELDS', [])) | set(['password'])
|
||||||
if field_name in password_fields:
|
if field_name in password_fields or (
|
||||||
|
isinstance(field_val, six.string_types) and
|
||||||
|
field_val.startswith('$encrypted$')
|
||||||
|
):
|
||||||
return u'hidden'
|
return u'hidden'
|
||||||
if hasattr(obj, 'display_%s' % field_name):
|
if hasattr(obj, 'display_%s' % field_name):
|
||||||
field_val = getattr(obj, 'display_%s' % field_name)()
|
field_val = getattr(obj, 'display_%s' % field_name)()
|
||||||
|
Loading…
Reference in New Issue
Block a user