bottleneckcrm/backend/webforms/public_urls.py
Ashwin 41250838ad Add comprehensive tests for web forms functionality
- Implement tests for web forms screen to ensure proper rendering and behavior on different devices.
- Create unit tests for web form model to validate JSON serialization and deserialization.
- Add tests for web forms provider to verify API interactions and state management.
- Ensure that publishing rules and field validations are correctly enforced in the tests.
2026-08-17 13:33:14 +05:30

33 lines
1 KiB
Python

"""Public web form routes, mounted at /api/public/forms/.
`org_id` is the FIRST segment after the fixed prefix, and that ordering is
load-bearing in exactly the way `common/portal_urls.py` documents.
`RequireOrgContext.EXEMPT_PATHS` is prefix-matched with `startswith`, so the
fixed `/api/public/forms/` prefix exempts these routes and nothing else.
Moving `org_id` ahead of the prefix would make the exemptable portion variable
and there would be no way to exempt these without exempting more.
"""
from django.urls import path
from webforms import public_views
app_name = "public_webforms"
urlpatterns = [
path(
"<uuid:org_id>/<uuid:form_id>/embed/",
public_views.WebFormEmbedView.as_view(),
name="embed",
),
path(
"<uuid:org_id>/<uuid:form_id>/embed.js",
public_views.WebFormEmbedJsView.as_view(),
name="embed_js",
),
path(
"<uuid:org_id>/<uuid:form_id>/submit/",
public_views.WebFormSubmitView.as_view(),
name="submit",
),
]