Skip to content
Snippets Groups Projects
Commit a3a56792 authored by Alexa Valentová's avatar Alexa Valentová
Browse files

hotfix

parent a5d9c58f
No related branches found
No related tags found
2 merge requests!1283Release,!1282hotfix
Pipeline #20855 passed
# Generated by Django 5.0.7 on 2025-03-26 06:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uniweb', '0134_uniwebhomepage_fbevents_id'),
]
operations = [
migrations.AddField(
model_name='uniwebformpage',
name='subscribe_to_ecomail',
field=models.BooleanField(default=False, verbose_name='Automaticky odebírat vyplněné údaje do Ecomail NL?'),
),
]
......@@ -496,6 +496,11 @@ class UniwebFormPage(
),
)
subscribe_to_ecomail = models.BooleanField(
verbose_name="Automaticky odebírat vyplněné údaje do Ecomail NL?",
default=False,
)
### PANELS
content_panels = AbstractForm.content_panels + [
......@@ -511,7 +516,7 @@ class UniwebFormPage(
submissions_panels = [FormSubmissionsPanel()]
advanced_panels = [FieldPanel("show_in_parent_page")]
advanced_panels = [FieldPanel("show_in_parent_page"), FieldPanel("subscribe_to_ecomail")]
edit_handler = TabbedInterface(
[
......@@ -535,7 +540,10 @@ class UniwebFormPage(
def serve(self, request):
if request.method == "GET" and self.show_in_parent_page:
return redirect(self.parent_page.url)
if hasattr(self, "parent_page"):
return redirect(self.parent_page.url)
else:
return redirect("/")
return super().serve(request)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment