diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2020-07-30 19:36:01 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2020-07-30 23:45:30 -0700 |
commit | a928882cb14eca8c50919f1af7489831b8341569 (patch) | |
tree | 23ad3835fb89321bfb40974380fef34b1f611e81 /python/fatcat_web/forms.py | |
parent | 6c2bc56b29d42737a62513520aec5dd148ccdcc9 (diff) | |
download | fatcat-a928882cb14eca8c50919f1af7489831b8341569.tar.gz fatcat-a928882cb14eca8c50919f1af7489831b8341569.zip |
remove some meta-fields from TOML form (all entities)
Diffstat (limited to 'python/fatcat_web/forms.py')
-rw-r--r-- | python/fatcat_web/forms.py | 6 |
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 |