From 1f8ffb5cba1a61badb509511dfacf45aa8515a78 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Thu, 28 Nov 2019 00:09:49 +0300 Subject: [PATCH] exclude mtg data field --- bots/modules/cyberlina.py | 1 + config/utils.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bots/modules/cyberlina.py b/bots/modules/cyberlina.py index 1d11e32..a87d281 100644 --- a/bots/modules/cyberlina.py +++ b/bots/modules/cyberlina.py @@ -38,6 +38,7 @@ class CyberLinaBotModuleConfig(TelegramBotModuleConfig): 'welcome_reactions': JSONEditor(), 'inline_reactions': JSONEditor(), } + EXCLUDE_FIELDS = '_mtg_data', def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/config/utils.py b/config/utils.py index 0c6f934..8817627 100644 --- a/config/utils.py +++ b/config/utils.py @@ -63,7 +63,7 @@ def get_config_form(mdl): class Meta: model = mdl - exclude = () + exclude = mdl.EXCLUDE_FIELDS if hasattr(mdl, 'EXCLUDE_FIELDS') else () widgets = mdl.CUSTOM_WIDGETS if hasattr(mdl, 'CUSTOM_WIDGETS') else {} return ConfigForm