fix bug saving extra_data and follow prompts rules

display_extra_vars was not taking a copy of the data before
acting on it - this causes a bug where the activity stream will
modify the existing object on the model. That leads to new data
not being accepted.

Also moved the processing of extra_data to prior to the accept
or ignore kwargs logic so that we pass the right (post-encryption)
form of the variables.
This commit is contained in:
AlanCoding
2017-12-18 09:40:04 -05:00
parent 1e1839915d
commit c8e10adc96
5 changed files with 34 additions and 24 deletions

View File

@@ -137,3 +137,9 @@ def encrypt_dict(data, fields):
encrypt_fields = set(data.keys()).intersection(fields)
for key in encrypt_fields:
data[key] = encrypt_value(data[key])
def is_encrypted(value):
if not isinstance(value, six.string_types):
return False
return value.startswith('$encrypted$') and len(value) > len('$encrypted$')