maccesch / cmsplugin-contact

Extendable contact plugin for django-cms with spam protection and i18n
BSD 2-Clause "Simplified" License
71 stars 62 forks source link

WIP: Success redirect reversing #87

Closed rfleschenberg closed 7 years ago

rfleschenberg commented 7 years ago

Hi,

this is a proposal / work in progress and not ready to merge yet.

Currently, the plugin only accepts fully-qualified URLs for the redirect_url field. This is not nice. I think the better way is to accept the reverse id of a CMS page to redirect to. This PR changes the behaviour accordingly.

What do you think about this?

One problem with this is that it's not clear how to upgrade existing deployments. It would probably require manual intervention. Any thoughts?

maccesch commented 7 years ago

Good idea! You're absolutely right, this should be the preferred behaviour. But to ensure maximum flexibility and also backwards compatibility ideally this should be configurable so users have both options. What do you think about that?

rfleschenberg commented 7 years ago

I agree. Another approach would be to introduce a new field for this and keep the old field around for a while. Use the new behavior if the new field is not empty, otherwise fall back to the old behavior. Maybe also validate at the form level that exactly one of the two fields is set.

maccesch commented 7 years ago

Actually that would be ideal because backwards compatibility would be certain. 👍🏼