viewflow / django-material

Material Design for Django
http://viewflow.io/
BSD 3-Clause "New" or "Revised" License
2.49k stars 425 forks source link

Bug 1.6.0 -> 1.6.3: After update forms submit to a wrong routes #473

Closed alex20465 closed 4 years ago

alex20465 commented 4 years ago

https://github.com/viewflow/django-material/commit/c525e9578dd8126581f806001721ff1609e7c2d5#diff-f4d3a6d290858d0bb8b34ee5bb6c0f0bR44

image

The _performPost was changed and leads to a wrong post-url:

Mostly the current location.search is an empty string "" the code above sets it to . which is a relative notation and transforms the url and makes it invalid, check the miss-behaviour:

image

kmmbvnr commented 4 years ago

Don't you have APPEND_SLASH==True? https://docs.djangoproject.com/en/3.0/ref/settings/#append-slash

alex20465 commented 4 years ago

APPEND_SLASH is enabled, but you have right, the route path was without a slash at the end:

    path('add/event', service_assignment_create_view, name="service_assignment_add_event"),

I've just changed it to:

    path('add/event/', service_assignment_create_view, name="service_assignment_add_event"),

and it worked. thanks