add a field to OPTIONS that tells if the setting came from a .py file

additionally, update help_text with a helpful message about this

See: #4876
This commit is contained in:
Ryan Petrello
2017-02-02 11:44:42 -05:00
parent 1ab62a48ed
commit afc0f16e58
5 changed files with 61 additions and 20 deletions

View File

@@ -32,6 +32,7 @@ class Metadata(metadata.SimpleMetadata):
'min_length', 'max_length',
'min_value', 'max_value',
'category', 'category_slug',
'defined_in_file'
]
for attr in text_attrs:
@@ -156,6 +157,10 @@ class Metadata(metadata.SimpleMetadata):
# For PUT/POST methods, remove read-only fields.
if method in ('PUT', 'POST'):
# This value should always be False for PUT/POST, so don't
# show it (file-based read-only settings can't be updated)
meta.pop('defined_in_file', False)
if meta.pop('read_only', False):
actions[method].pop(field)