From a928882cb14eca8c50919f1af7489831b8341569 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 30 Jul 2020 19:36:01 -0700 Subject: remove some meta-fields from TOML form (all entities) --- python/fatcat_web/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3