aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2020-07-30 19:36:01 -0700
committerBryan Newbold <bnewbold@robocracy.org>2020-07-30 23:45:30 -0700
commita928882cb14eca8c50919f1af7489831b8341569 (patch)
tree23ad3835fb89321bfb40974380fef34b1f611e81
parent6c2bc56b29d42737a62513520aec5dd148ccdcc9 (diff)
downloadfatcat-a928882cb14eca8c50919f1af7489831b8341569.tar.gz
fatcat-a928882cb14eca8c50919f1af7489831b8341569.zip
remove some meta-fields from TOML form (all entities)
-rw-r--r--python/fatcat_web/forms.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/fatcat_web/forms.py b/python/fatcat_web/forms.py
index b06788b8..13776d10 100644
--- a/python/fatcat_web/forms.py
+++ b/python/fatcat_web/forms.py
@@ -437,5 +437,9 @@ class EntityTomlForm(EntityEditForm):
Initializes form with TOML version of existing entity
"""
etf = EntityTomlForm()
- etf.toml.data = entity_to_toml(entity)
+ if entity.state == 'active':
+ pop_fields = ['ident', 'state', 'revision', 'redirect']
+ else:
+ pop_fields = ['ident', 'state']
+ etf.toml.data = entity_to_toml(entity, pop_fields=pop_fields)
return etf