Bhupesh-V / tutorialdb

A search 🔎 engine for programming/dev tutorials,
MIT License
121 stars 60 forks source link

No redirect in ContributeView. #17

Closed Animesh-Ghosh closed 4 years ago

Animesh-Ghosh commented 4 years ago

When I tried to submit an invalid link, instead of the URL being /contribute/ as it should, it is /thankyou/.

image

Also, shouldn't the site redirect to /thankyou/ after a successful form submission? Instead of a render shouldn't it be an HttpResponseRedirect in the ContributeView's post method? I may be wrong about this, but there is a bug vis a vis the URL.

Animesh-Ghosh commented 4 years ago

After a successful form submission, it renders the correct template and the correct URL is generated.

The above-mentioned bug is still there.

Bhupesh-V commented 4 years ago

When I tried to submit an invalid link, instead of the URL being /contribute/ as it should, it is /thankyou/.

Yes the URL persists, I would have to take a different approach for this, Thanks for reporting.

Fixed in commit :heavy_check_mark:

Animesh-Ghosh commented 4 years ago

The contribute form should properly redirect to the /thankyou/ URL.

Check this link for the redirect shortcut.

Reopening this issue.

Animesh-Ghosh commented 4 years ago

Closing since I couldn't find any better alternatives.

May be reopened if a better alternative implementation for ContributeView is found/made.

Animesh-Ghosh commented 4 years ago

Found a possible fix. Reopening issue.

PR incoming.