Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: forms did not redirect to same page if sent from alias #20

Merged
merged 8 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ jobs:
matrix:
python-version: [ 3.9, "3.10", "3.11", "3.12"] # latest release minus two
requirements-file: [
dj32_cms310.txt,
dj32_cms311.txt,
dj42_cms311.txt,
dj42_cms41.txt,
dj50_cms41.txt,
dj51_cms41.txt,
]
os: [
ubuntu-20.04,
Expand Down
7 changes: 5 additions & 2 deletions djangocms_form_builder/cms_plugins/ajax_plugins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import json

Check failure on line 1 in djangocms_form_builder/cms_plugins/ajax_plugins.py

View workflow job for this annotation

GitHub Actions / isort

Imports are incorrectly sorted and/or formatted.

Check failure on line 1 in djangocms_form_builder/cms_plugins/ajax_plugins.py

View workflow job for this annotation

GitHub Actions / isort

Imports are incorrectly sorted and/or formatted.
from urllib.parse import urlencode

from cms.plugin_base import CMSPluginBase
Expand All @@ -20,6 +20,9 @@
from ..helpers import get_option, insert_fields, mark_safe_lazy


SAME_PAGE_REDIRECT = "result"


class CMSAjaxBase(CMSPluginBase):
def ajax_post(self, request, instance, parameter):
return JsonResponse({})
Expand Down Expand Up @@ -351,7 +354,7 @@
fields = {}
traverse(self.instance)

# Add recaptcha field in necessary
# Add recaptcha field if necessary
if recaptcha.installed and self.instance.captcha_widget:
fields[recaptcha.field_name] = recaptcha.get_recaptcha_field(self.instance)

Expand All @@ -364,7 +367,7 @@
] = f'{self.instance.form_spacing}'
meta_options[
"redirect"
] = self.instance.placeholder.page # Default behavior: redirect to same page
] = SAME_PAGE_REDIRECT # Default behavior: redirect to same page
meta_options["login_required"] = self.instance.form_login_required
meta_options["unique"] = self.instance.form_unique
form_actions = self.instance.form_actions or "[]"
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Framework :: Django CMS",
"Framework :: Django CMS :: 3.9",
"Framework :: Django CMS :: 3.10",
"Framework :: Django CMS :: 3.11",
"Framework :: Django CMS :: 3.8",
"Framework :: Django CMS :: 3.9",
"Framework :: Django CMS :: 4.0",
"Framework :: Django CMS :: 4.1",
"Intended Audience :: Developers",
Expand Down
Loading