-
Notifications
You must be signed in to change notification settings - Fork 32
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 locations endpoint error when default translation is not public #2125
Conversation
Code Climate has analyzed commit bca8ddb and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 83.3% (50% is the threshold). This pull request will bring the total coverage in the repository to 76.1% (0.0% change). View more on Code Climate. |
b168190
to
7992a1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good :-).
Peter and me suggest that you wanted to use continue instead of break to skip just the current POI instead of all the following.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! 👍
This handles the existing incorrectly published translations in a way that prevents the API error, but I would like to add one of the following to make it easier for content creators to understand the change:
- Either create a migration that unpublishes all translations in this state, otherwise it might be confusing if they see "published" as status but they are not showing up in the app
- Or add a small warning in the page form view whenever a public location is not visible in the app because of a missing default translation
Apart from that, it raises a small UI/UX problem:
The "draft" button looks exactly like the disabled "update" button. I think this is more the problem of the draft button than of the disabled button, so it's probably fine to merge this PR, but we should find a new color for non-disabled secondary buttons soon.
Edit: I opened a new ticket for this:
85be968
to
41eacb4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added migration to update POI translation status to DRAFT, if there is no default public translation.
(hope I didn't miss anything, as I couldn't test it on real data).
It raises a small UI/UX problem
I noticed it too, but didn't come up with an idea for improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! 👍
Other than the performance optimization in the migration, I think this is good to go! 🚀
integreat_cms/cms/migrations/0066_update_poi_translation_status.py
Outdated
Show resolved
Hide resolved
485f2e5
to
2cda550
Compare
integreat_cms/cms/migrations/0066_update_poi_translation_status.py
Outdated
Show resolved
Hide resolved
integreat_cms/cms/migrations/0066_update_poi_translation_status.py
Outdated
Show resolved
Hide resolved
672b617
to
cfcfa5b
Compare
Co-authored-by: Timo Ludwig <timo.ludwig@tuerantuer.org>
cfcfa5b
to
bca8ddb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Works as expected 👍
Short description
When a region creates a location which is a draft in the default language, but public in other languages, the location API returns an internal server error
Proposed changes
Side effects
Didn't find any
Resolved issues
Fixes: #2097
Pull Request Review Guidelines