Project

General

Profile

Development #56930

export/import sans maps ni pwa

Added by Frédéric Péters 14 days ago. Updated 4 days ago.

Status:
Résolu (à déployer)
Priority:
Normal
Target version:
-
Start date:
14 Sep 2021
Due date:
% Done:

0%

Estimated time:
Patch proposed:
Yes
Planning:
No

Description

Sur des sites qui n'auraient pas combo.apps.maps ou combo.apps.pwa dans INSTALLED_APPS (dans un cadre qui n'est pas une installation Publik), on se trouve quand même devoir les inclure parce que l'export/import y fait référence :

  File "/home/fred/src/eo/combo/combo/plugins.py", line 61, in register_plugins_urls
    urls = get_plugin_includes(plugin, 'get_before_urls')
  File "/home/fred/src/eo/combo/combo/plugins.py", line 39, in get_plugin_includes
    urls = getattr(plugin, url_serie)()
  File "/home/fred/src/eo/combo/combo/apps/search/__init__.py", line 29, in get_before_urls
    from . import urls
  File "/home/fred/src/eo/combo/combo/apps/search/urls.py", line 21, in <module>
    from . import manager_views
  File "/home/fred/src/eo/combo/combo/apps/search/manager_views.py", line 33, in <module>
    from combo.manager.views import ManagedPageMixin
  File "/home/fred/src/eo/combo/combo/manager/views.py", line 50, in <module>
    from combo.data.utils import ImportSiteError, export_site, export_site_tar, import_site, import_site_tar
  File "/home/fred/src/eo/combo/combo/data/utils.py", line 30, in <module>
    from combo.apps.pwa.models import PwaNavigationEntry, PwaSettings
  File "/home/fred/src/eo/combo/combo/apps/pwa/models.py", line 36, in <module>
    class PwaSettings(models.Model):
  File ".../venv3/lib/python3.9/site-packages/django/db/models/base.py", line 108, in __new__
    raise RuntimeError(
RuntimeError: Model class combo.apps.pwa.models.PwaSettings doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

Pour lingo on fait déjà quelque chose comme

    if 'combo.apps.lingo' in settings.INSTALLED_APPS:
        from combo.apps.lingo.models import PaymentBackend, Regie
    else:
        payment = False

et je propose d'appliquer la même recette pour maps et pwa.


Files

Associated revisions

Revision 11b4ffca (diff)
Added by Frédéric Péters 4 days ago

utils: do not require maps and pwa apps for export/import support (#56930)

History

#1

Updated by Frédéric Péters 14 days ago

#2

Updated by Nicolas Roche 6 days ago

  • Status changed from Solution proposée to Solution validée
#3

Updated by Frédéric Péters 4 days ago

  • Status changed from Solution validée to Résolu (à déployer)
commit 11b4ffca3816885d52b2e579ef8293e9a9d69ee1
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Tue Sep 14 12:13:42 2021 +0200

    utils: do not require maps and pwa apps for export/import support (#56930)

Also available in: Atom PDF