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

When updating a project submission with invalid link, other submitted fields are reset #66

Open
alexeygrigorev opened this issue Aug 30, 2024 · 1 comment

Comments

@alexeygrigorev
Copy link
Member

Steps to reproduce

  • create a project submission
  • edit it
  • replace the project url with invalid link
  • add more learning in public links
  • submit
  • the updated learning in public links are gone

The test test_submission_exist_post_with_error in test_project_view.py reproduces it (currently commented)

A fix would require a major redesign of the project view. One of the potential solutions would be using a django form and validations there, e.g. like in the enrollement vide

@RohanJnr
Copy link

Using a model form in this case like you mentioned would solve this issue by just re-rendering the user submitted form on errors without changing the entires.
Although if you are looking for quick fix, then since you are retrieving all the values from the post body in code, you can convert the POST route to an api and use JS/HTMX in the frontend for sending the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants