c2corg / v6_api

REST API for https://www.camptocamp.org
GNU Affero General Public License v3.0
22 stars 26 forks source link

Missing title_prefix for routes to "hut" waypoints #307

Closed asaunier closed 7 years ago

asaunier commented 8 years ago

In v5, some routes describe the way to a hut.

It seems in v6, those routes have no "title_prefix", as a result the displayed name is a bit confusing. For instance http://localhost:6555/routes/375767/fr named "Depuis Kühboden", which actually describes the way to the Konkordiahütte http://localhost:6555/waypoints/109398/fr The route has no "main waypoint" (should be the hut WP here) but is associated to an "access" WP and 2 (!) Konkordiahütte WP.

This is not really a duplicated associations: there are actually 2 WP named Konkordiahütte, one being a "fake" summit automatically created in v5 when creating a route to a hut (because in v5 routes require to be linked to at list one "summit" doc).

TODO:

asaunier commented 8 years ago

Other examples: http://c2corgv6.demo-camptocamp.com/routes/685870/fr/depuis-zadnjica http://c2corgv6.demo-camptocamp.com/routes/685693/fr/depuis-savica

tsauerwein commented 7 years ago

Allowing huts as main waypoint is trivial (see https://github.com/c2corg/v6_api/blob/master/c2corg_api/scripts/migration/documents/associations.py#L198-L200), the title_prefix will then be set.

But removing the fake summits (summits with summit type 100) is more complex. It would mean:

asaunier commented 7 years ago

What about implementing the document merging and deleting systems (both are required anyway, see https://github.com/c2corg/v6_api/issues/465 and https://github.com/c2corg/v6_api/issues/386)

After the migration we could run a special script that would browse the hut waypoints, detect duplicates, merge the most recent (?) document (this would transfer all associations to the remaining document) and finally remove the merged document (no longer needed) using the standard merging and deleting systems.

asaunier commented 7 years ago

I suggest to move this discussion to https://github.com/c2corg/v6_api/issues/225