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

Issue with load_data_from_po() with MySQL database #35

Open
kbultman opened this issue Feb 19, 2020 · 1 comment
Open

Issue with load_data_from_po() with MySQL database #35

kbultman opened this issue Feb 19, 2020 · 1 comment

Comments

@kbultman
Copy link

kbultman commented Feb 19, 2020

OperationalError: (1093, "You can't specify target table 'translation_manager_translationentry' for update in FROM clause")

caused by: TranslationEntry.objects.filter(original__in=published.values_list('original', flat=True)).update(is_published=True)

MySQL doesn't allow updating the table you are already using in an inner select as the update criteria.
Fix is to wrap published values in list:
TranslationEntry.objects.filter(original__in=list(published.values_list('original', flat=True))).update(is_published=True)

@Krakenus
Copy link
Member

@kbultman Hello, do you know which django or mysql version did this? I wasn't able to replicate the issue.

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