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

background object creation failing in relation form #1397

Open
b1rger opened this issue Nov 15, 2024 · 6 comments
Open

background object creation failing in relation form #1397

b1rger opened this issue Nov 15, 2024 · 6 comments
Assignees

Comments

@b1rger
Copy link
Contributor

b1rger commented Nov 15, 2024

So I'll create a separate issue for the background object creation failing and close this one. Thanks for the answers!

Originally posted by @gythaogg in #1364 (comment)

This refers to the autocomplete not giving appropriate feedback if the creation of an object did not succeed

@b1rger b1rger self-assigned this Nov 15, 2024
@gythaogg
Copy link
Contributor

Thank you, this is correct - my new issue tab is still in draft as I was investigating the slightly different ways in which many to many fields record creation in forms failed and wasn't sure if I should report different issues or a common one.

@gythaogg
Copy link
Contributor

This one I mean #1363 - didn't have time to check if the root cause is the same as this one.

@b1rger
Copy link
Contributor Author

b1rger commented Nov 15, 2024

Thank you, this is correct - my new issue tab is still in draft as I was investigating the slightly different ways in which many to many fields record creation in forms failed and wasn't sure if I should report different issues or a common one.

no problem, its a complicated matter as I just found out myself ;)

This refers to the autocomplete not giving appropriate feedback if the creation of an object did not succeed

so actually this is only about the relations form autocomplete. If the other autocompletes have a Create ... option and the create fails, it shows an error message, but that error message is not really helpful. I've created #1398 to make this error message bit more meaningful.
For the relations autocomplete, this error message (which is returned by the autocomplete endpoint in the error field of the JSON response) somehow does not show up. I guess thats (again) a problem with our custom reinit_select2 event listener

@b1rger
Copy link
Contributor Author

b1rger commented Nov 15, 2024

I guess thats (again) a problem with our custom reinit_select2 event listener

we probably have to copy the success function:
https://github.com/yourlabs/django-autocomplete-light/blob/45a9ff6e95e58348b90b3c1f01f01cb6ca10b4d3/src/dal_select2/static/autocomplete_light/select2.js#L128

@gythaogg
Copy link
Contributor

@b1rger This is now fixed, right?

@b1rger
Copy link
Contributor Author

b1rger commented Nov 20, 2024

@b1rger This is now fixed, right?

Well, when the creation process fails, this still does not show the error message, so I'd keep that open until we have fixed that

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