Repository navigation
Conversation
GET /sections/abroad lists every abroad section with its town, country, committee name (place) and street address, publicly, so the site no longer needs a generated copy of the МВнР table. PATCH /sections/abroad/addresses (Manage Section) and npm run sections:update-abroad-addresses set the address of existing 32* sections from a CSV or JSON: only that column is written, unknown ids are reported and never created, nothing is deleted, dryRun rolls back. scripts/sections-preprocess/mfa_abroad_addresses.py turns the МВнР xlsx into that CSV. See docs/abroad-addresses.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Steps 3–4 of keeping the abroad section addresses in the API. It builds on #282 (the
addresscolumn).GET /sections/abroad(public,Cache-Control: public, max-age=300){id, code, place, address, town: {id, name}, country: {code, name}}.PATCH /sections/abroad/addresses(admin,Manage Section) andnpm run sections:update-abroad-addresses -- file.csv [--dry-run]file(section_id/id/№ на секция+address/Адрес; other columns ignored) or JSON{"sections":[{"id","address"}]}.sections.addressof existing 32* sections, inside a transaction under an advisory lock.{dryRun, received, updated:[{id,from,to}], unchanged, unknown}. WithdryRuneverything is rolled back.Also
scripts/sections-preprocess/mfa_abroad_addresses.py: the МВнР xlsx → CSV (moved from the site'sscripts/mfa-abroad-addresses.py). On the current table (upload 166450) it gives 613 sections, all with an address, identical to the site's data file.docs/abroad-addresses.md.SectionsController, so/sections/abroadis not read as/sections/:section.Tests
dryRun, 400s, 403 for non-admins.unknownis reported, dry run writes nothing, list shape.Unlike #272 (full replace of the abroad sections), this never creates or deletes sections.