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

Fix /admin/imports on localhost #4703

Merged
merged 5 commits into from
Mar 10, 2021
Merged

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Mar 1, 2021

Fixes #2316

Database table import_item may not exist on localhost so detect and log psycopg2.errors.UndefinedTable and return a count of 0 or an empty list.

Is there a way to solve this with less code by creating an empty import_item database table?

Should we reduce or eliminate the logging?

Closes #

Technical

Testing

Screenshot

Stakeholders

Fixes #2316

Database table `import_item` may not exist on localhost so detect and log `psycopg2.errors.UndefinedTable` and return a count of 0.
@cclauss
Copy link
Contributor Author

cclauss commented Mar 1, 2021

Screenshot 2021-03-01 at 16 58 55

Copy link
Collaborator

@jdlrobson jdlrobson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this and it fixes the issue for me locally. Don't know enough about this part of the code to merge though.

@mekarpeles
Copy link
Member

Another alternative is creating that table (as if we even have to startup a prod db again, we probably want that table to exist somewhere). For now, code as is looks like an improvement; merging

@mekarpeles mekarpeles merged commit 54bb3da into master Mar 10, 2021
@mekarpeles mekarpeles deleted the Fix-/admin/imports-on-localhost branch March 10, 2021 04:28
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

Successfully merging this pull request may close these issues.

/admin/imports fails to load locally
4 participants