The Edit Resource form (and others) have a pattern like:
if form.is_valid():
form.save()
else:
return server_error(request)
which when combined with potentially-common user mistakes (like entering the wrong type of content) generates spurious 500 errors and doesn't give the user enough info to correct their mistakes.
It would probably be better to:
Use semantic HTML to prevent common errors (e.g. URLs that aren't valid), as on the Edit Link form.
Ensure that any user-addressable errors are displayed on the front end, with clear messaging. Usually this means just letting Django deal with the invalid form in the template.
If the validation error is not addressable or is unknown, a Bad Request is preferred to a server error.
The Edit Resource form (and others) have a pattern like:
which when combined with potentially-common user mistakes (like entering the wrong type of content) generates spurious 500 errors and doesn't give the user enough info to correct their mistakes.
It would probably be better to: