From a441b899721e6b07e94d7af362399693e5add05c Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Fri, 27 Sep 2024 19:59:32 +0200 Subject: [PATCH] fix linting issues --- djangocms_frontend/cms_plugins.py | 4 +++- djangocms_frontend/contrib/grid/forms.py | 2 ++ djangocms_frontend/helpers.py | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/djangocms_frontend/cms_plugins.py b/djangocms_frontend/cms_plugins.py index 60a4356a..46fd5935 100644 --- a/djangocms_frontend/cms_plugins.py +++ b/djangocms_frontend/cms_plugins.py @@ -37,7 +37,9 @@ def get_plugin_urls(self): from django.urls import re_path info = f"{self.model._meta.app_label}_{self.model._meta.model_name}" - pat = lambda regex, fn: re_path(regex, fn, name=f"{info}_{fn.__name__}") + + def pat(regex, fn): + return re_path(regex, fn, name=f"{info}_{fn.__name__}") return [ pat(r'edit-field/(%s)/([a-z\-]+)/$' % SLUG_REGEXP, self.edit_field), diff --git a/djangocms_frontend/contrib/grid/forms.py b/djangocms_frontend/contrib/grid/forms.py index e30d94ec..5772fbdd 100644 --- a/djangocms_frontend/contrib/grid/forms.py +++ b/djangocms_frontend/contrib/grid/forms.py @@ -137,8 +137,10 @@ class Meta: max_value=GRID_SIZE, ) + GridRowBaseForm.Meta.entangled_fields["config"] += extra_fields_column.keys() + GridRowForm = type( "GridRowBaseForm", (GridRowBaseForm,), diff --git a/djangocms_frontend/helpers.py b/djangocms_frontend/helpers.py index 61a91371..c07cfff8 100644 --- a/djangocms_frontend/helpers.py +++ b/djangocms_frontend/helpers.py @@ -160,7 +160,10 @@ def get_urls(self): Register the url for the single field edit view """ info = f"{self.model._meta.app_label}_{self.model._meta.model_name}" - pat = lambda regex, fn: re_path(regex, self.admin_site.admin_view(fn), name=f"{info}_{fn.__name__}") + + def pat(regex, fn): + return re_path(regex, self.admin_site.admin_view(fn), name=f"{info}_{fn.__name__}") + url_patterns = [ pat(r'edit-field/(%s)/([a-z\-]+)/$' % SLUG_REGEXP, self.edit_field), ]