Skip to content

Commit

Permalink
Deprecate Geotrek-rando v2 (sync_rando command and view are removed) (
Browse files Browse the repository at this point in the history
#3752) (#3991)

* delete sync_rando command and views

* fix tests

* update documentation

* cleaning

* move report endpoint

* add feedback report in API v2

* fix translations

* pep8

* delete Rando v2 Meta specific code

* Clean useless code (#4009)

* clean flatpages

* clean authent

* clean core

* clean outdoor

* clean diving

* clean signages

* clean infrastructure

* clean sensitivity

* clean tourism

* clean trekking

* clean common

* fix test logs

* revert change

* clean useless code

* fix coverage

* clean unused methods and files

* clean unused methods and files

* fix and add test

* improve coverage

* clean

* improve sensitivity tests

* improve infrastructure tests

* improve signage tests

* improve mixin coverage

* revert

* revert

* improve coverage

* improve coverage

* improve coverage

* delete unused code

* update translations

* format new files

* fix tests

* fix tests

* fix tests
  • Loading branch information
submarcos committed Mar 26, 2024
1 parent 34919be commit e3c53c7
Show file tree
Hide file tree
Showing 247 changed files with 1,742 additions and 8,158 deletions.
1 change: 1 addition & 0 deletions dev-requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-c requirements.txt

pip-tools
lxml
flake8
freezegun
coverage
Expand Down
4 changes: 4 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ importlib-metadata==6.8.0
# via
# -c requirements.txt
# build
lxml==4.9.3
# via
# -c requirements.txt
# -r dev-requirements.in
mccabe==0.7.0
# via flake8
packaging==21.3
Expand Down
10 changes: 10 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ CHANGELOG
2.103.2+dev (XXXX-XX-XX)
------------------------

**Breaking changes**

- Geotrek-rando v2 support is deprecated, `sync_rando` command and Sync rando menu view are removed.

**Hot fix**

- Add git to Dockerfile build staging


2.103.2 (2024-03-22)
--------------------

Expand All @@ -21,6 +30,7 @@ CHANGELOG

- Add git to Dockerfile build staging


2.103.1 (2024-03-15)
--------------------

Expand Down
46 changes: 0 additions & 46 deletions docs/install/advanced-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -914,18 +914,6 @@ Attributes for "zones sensibles réglementaires" are:
* ``url`` : card url. Optional.


Sync to Geotrek-rando
'''''''''''''''''''''''

Just run:

.. code-block :: bash
sudo geotrek sync_rando <parameters>
If sensitivity module is enabled, sensitive areas will be automatically synchronized.


Feedback reports settings
-------------------------

Expand Down Expand Up @@ -963,9 +951,6 @@ To initialize Report forms (Geotrek-admin, Geotrek-rando-V2, Geotrek-rando-V3) l
geotrek loaddata /opt/geotrek-admin/lib/python*/site-packages/geotrek/feedback/fixtures/basic.json
To make these lists available for your Geotrek-rando-V2, run ``sync_rando`` (see :ref:`synchronization <synchronization-section>`)


**2 - Suricate Standard**

This mode simply forwards all reports to Suricate, using the Standard API to post reports.
Expand Down Expand Up @@ -1118,8 +1103,6 @@ Load alerts from Suricate (located in your bounding box) :
geotrek sync_suricate -v 2 --no-notification
To make these lists available for your Geotrek-rando, run ``sync_rando`` (see :ref:`synchronization <synchronization-section>`)

- Then load extra required statuses for Reports and Interventions:

.. code-block :: python
Expand Down Expand Up @@ -2866,7 +2849,6 @@ Example of a customised template (``/opt/geotrek-admin/var/conf/extra_templates/
The default template may change in the future versions. You will be in charge of porting the modification to your copy.
Test your modifications by exporting a trek or a content to PDF from Geotrek-admin application.
To get your modifications available for Rando application, launch the ``sync_rando`` command.


PDF as booklet
Expand Down Expand Up @@ -2953,34 +2935,6 @@ You might also need to deploy logo images in the following places :
Settings for Geotrek-rando
--------------------------

Synchro Geotrek-rando
~~~~~~~~~~~~~~~~~~~~~
With Geotrek-rando V2, there is a synchronization mechanism to expose Geotrek-admin contents in json files generated automatically.

.. warning::
This is no more used in Geotrek-rando V3.


.. envvar:: SYNC_RANDO_ROOT

Path on your server where the data for Geotrek-rando website will be generated

Example::

SYNC_RANDO_ROOT = os.path.join(VAR_DIR, 'data')

.. note::
- If you want to modify it, do not forget to import os at the top of the file.
- Check `import Python <https://docs.python.org/3/reference/import.html>`_ , if you need any information

.. envvar:: SYNC_RANDO_OPTIONS

Options of the sync_rando command in Geotrek-admin interface.

Example::

SYNC_RANDO_OPTIONS = {}

.. _distances:

Distances
Expand Down
117 changes: 11 additions & 106 deletions docs/install/synchronization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,20 @@ Synchronization
:local:
:depth: 2

Manual synchronization
----------------------

To create data for Geotrek-rando (public web portal) and Geotrek-mobile (mobile phone app),
just run this command:

::

sudo geotrek sync_rando /opt/geotrek-admin/var/data

The parameter is the destination directory for synchronized data.
If you choose another directory, make sure the parent of this directory is writable by geotrek user.
Otherwise you will get a PermissionError message.

If Geotrek-admin is not accessible on localhost:80, you have to use the ``--url`` option.
To make output less or more verbose, you can use the ``--verbose`` option.
Geotrek-mobile app v3
---------------------

Since version 2.4.0 of Geotrek-admin, you can also launch the command ``sync_rando`` from the web interface.
You can add synchronization options with advanced configuration setting ``SYNC_RANDO_OPTIONS = {}``.
The Geotrek-mobile app v3 has its own API and synchronization command called ``sync_mobile``.

For example, if you add this line in ``/opt/geotrek-admin/var/conf/custom.py`` you will skip generation of map tiles files during the synchronisation :
``SYNC_RANDO_OPTIONS = {'skip_tiles': True}``
::

geotrek sync_mobile [-h] [--languages LANGUAGES] [--portal PORTAL]
[--skip-tiles] [--url URL] [--indent INDENT]
[--version] [-v {0,1,2,3}] [--settings SETTINGS]
[--pythonpath PYTHONPATH] [--traceback]
[--no-color] [--force-color]
path

Automatic synchronization
-------------------------
Expand All @@ -39,81 +30,12 @@ You can set up automatic synchronization by creating a file ``/etc/cron.d/geotre

::

0 3 * * * root /usr/sbin/geotrek sync_rando /opt/geotrek-admin/var/data
0 3 * * * root /usr/sbin/geotrek sync_mobile /opt/geotrek-admin/var/data

This example will automatically synchronize data a 3 am every day.

Note: it is required to give the full path to the geotrek command since cron set the PATH only to `bin:/usr/bin`.

Synchronization options
-----------------------

::

Options:
-v VERBOSITY, --verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal output,
2=verbose output
-u URL, --url=URL Base URL of Geotrek-admin (eg. http://geotrek.myorganization.com)
-r URL, --rando-url=URL
Base URL of public Geotrek-rando website, used for static html versions of objects pages
generated for Facebook in meta folder of data API
-s SOURCE, --source=SOURCE
Filter by source(s)
-P PORTAL, --portal=PORTAL
Filter by portal(s)
-p, --skip-pdf Skip generation of PDF files
-t, --skip-tiles Skip generation of map tiles files for Geotrek-mobile app v2
-d, --skip-dem Skip generation of Digital Elevation Model files for 3D view
-e, --skip-profile-png
Skip generation of PNG elevation profile
-w, --with-touristicevents
Include touristic events by trek in global.zip for Geotrek-mobile v2
-c CONTENT_CATEGORIES, --with-touristiccontent-categories=CONTENT_CATEGORIES
Include touristic contents by trek in global.zip for Geotrek-mobile v2
(filtered by category ID ex: --with-touristiccontent-categories="1,2,3")
-g, --with-signages Include published signages
-i, --with-infrastructures
Include published infrastructures

Geotrek-mobile v3 uses its own synchronization command (see below).
If you are not using Geotrek-mobile v2 anymore, it is recommanded to use ``-t`` option to don't generate big offline tiles directories,
not used elsewhere than in Geotrek-mobile v2. Same for ``-w`` and ``-c`` option, only used for Geotrek-mobile v2.


Synchronization filtered by source and portal
---------------------------------------------

You can filter treks, touristic contents, touristic events and static pages by source(s).
For example, if you created 3 sources records named ``source A``, ``source B`` and ``source C``
and you want to only export data from ``source A`` and ``source B`` to your web public portal, you can synchronize with:

::

sudo geotrek sync_rando --source "source A,source B" dataAB

Multiple sources are separated with comas (without space before or after coma). Do not forget to add double quotes after and before the parameter
if there are spaces in source names.
You can run several commands to export several sources combinations into several directories and use them to publish several distinct web portals.

You can do exactly the same with ``Target_Portal`` field value. It will include objects associated to the selected portal + those without portal.

::

sudo geotrek sync_rando --portal "portal A" dataA


Synchronization filtered by touristic content categories
--------------------------------------------------------

In Geotrek-mobile v2, you can choose to also include touristic content per trek. You must specify ID categories :

::

sudo geotrek sync_rando --with-touristiccontent-categories="1,3"

Multiple categories are separated with comas (without space before or after coma).


Synchronization with a distant Geotrek-rando server
---------------------------------------------------
Expand All @@ -126,20 +48,3 @@ If you have separated servers, you have to copy files, for example with ``rsync`
::

rsync /path/of/generated/data other-server:/path/of/generated/data


Geotrek-mobile app v3
---------------------

The Geotrek-mobile app v3 has its own API and synchronization command called ``sync_mobile``.

It has similar parameters as ``sync_rando``:

::

sudo geotrek sync_mobile [-h] [--languages LANGUAGES] [--portal PORTAL]
[--skip-tiles] [--url URL] [--indent INDENT]
[--version] [-v {0,1,2,3}] [--settings SETTINGS]
[--pythonpath PYTHONPATH] [--traceback]
[--no-color] [--force-color]
path
2 changes: 1 addition & 1 deletion geotrek/altimetry/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-18 10:49+0000\n"
"POT-Creation-Date: 2024-03-22 14:32+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion geotrek/altimetry/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-18 10:49+0000\n"
"POT-Creation-Date: 2024-03-22 14:32+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion geotrek/altimetry/locale/es/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-18 10:49+0000\n"
"POT-Creation-Date: 2024-03-22 14:32+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion geotrek/altimetry/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-18 10:49+0000\n"
"POT-Creation-Date: 2024-03-22 14:32+0000\n"
"PO-Revision-Date: 2015-10-06 12:11+0100\n"
"Language-Team: \n"
"Language: fr\n"
Expand Down
2 changes: 1 addition & 1 deletion geotrek/altimetry/locale/it/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-18 10:49+0000\n"
"POT-Creation-Date: 2024-03-22 14:32+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion geotrek/altimetry/locale/nl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-18 10:49+0000\n"
"POT-Creation-Date: 2024-03-22 14:32+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
30 changes: 0 additions & 30 deletions geotrek/altimetry/serializers.py

This file was deleted.

2 changes: 1 addition & 1 deletion geotrek/altimetry/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class ProfileViewsTest(TestCase):
@classmethod
def setUpTestData(cls):
cls.user = UserFactory(password='booh')
cls.user = UserFactory()

def test_profile_model_do_not_exist(self):
self.client.force_login(user=self.user)
Expand Down
17 changes: 16 additions & 1 deletion geotrek/api/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-18 10:49+0000\n"
"POT-Creation-Date: 2024-03-22 14:32+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -565,3 +565,18 @@ msgid ""
"This field is deprecated and will be removed in next releases. Please start "
"using '%(field)s'"
msgstr ""

msgid "Geotrek : Signal a mistake"
msgstr ""

msgid ""
"Hello,\n"
"\n"
"We acknowledge receipt of your feedback, thank you for your interest in "
"Geotrek.\n"
"\n"
"Best regards,\n"
"\n"
"The Geotrek Team\n"
"http://www.geotrek.fr"
msgstr ""

0 comments on commit e3c53c7

Please sign in to comment.