richie 3.0.1.dev5__py2.py3-none-any.whl → 3.0.1.dev8__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of richie might be problematic. Click here for more details.

@@ -1,17 +0,0 @@
1
- """Define SearchConfig as the default app configuration."""
2
-
3
- from django.conf import settings
4
-
5
- from .elasticsearch import (
6
- ElasticsearchClientCompat7to6,
7
- ElasticsearchIndicesClientCompat7to6,
8
- )
9
-
10
- # pylint: disable=invalid-name
11
- default_app_config = "richie.apps.search.apps.SearchConfig"
12
-
13
- ES_CLIENT = ElasticsearchClientCompat7to6(
14
- getattr(settings, "RICHIE_ES_HOST", ["elasticsearch"])
15
- )
16
-
17
- ES_INDICES_CLIENT = ElasticsearchIndicesClientCompat7to6(ES_CLIENT)
@@ -1,6 +1,41 @@
1
1
  """Signals to update the Elasticsearch indices when page modifications are published."""
2
2
 
3
+ # Define the global ES_CLIENT and ES_INDICES_CLIENT variables
4
+
3
5
  from django.apps import AppConfig
6
+ from django.conf import settings
7
+
8
+ from .elasticsearch import (
9
+ ElasticsearchClientCompat7to6,
10
+ ElasticsearchIndicesClientCompat7to6,
11
+ )
12
+
13
+ ES_CLIENT = None
14
+ ES_INDICES_CLIENT = None
15
+
16
+
17
+ def init_es():
18
+ """
19
+ Initialize the Elasticsearch client and indices client.
20
+ """
21
+ global ES_CLIENT # pylint: disable=global-statement
22
+ ES_CLIENT = ElasticsearchClientCompat7to6(
23
+ getattr(settings, "RICHIE_ES_HOST", ["elasticsearch"]),
24
+ **getattr(settings, "RICHIE_ES_CLIENT_KWARGS", {}),
25
+ )
26
+ global ES_INDICES_CLIENT # pylint: disable=global-statement
27
+ ES_INDICES_CLIENT = ElasticsearchIndicesClientCompat7to6(ES_CLIENT)
28
+
29
+
30
+ # pylint: disable=import-outside-toplevel,cyclic-import
31
+ def init_signals():
32
+ """Register signals to update the Elasticsearch indices."""
33
+ from cms.signals import post_publish, post_unpublish
34
+
35
+ from .signals import on_page_published, on_page_unpublished
36
+
37
+ post_publish.connect(on_page_published, dispatch_uid="search_post_publish")
38
+ post_unpublish.connect(on_page_unpublished, dispatch_uid="search_post_unpublish")
4
39
 
5
40
 
6
41
  class SearchConfig(AppConfig):
@@ -9,14 +44,9 @@ class SearchConfig(AppConfig):
9
44
  name = "richie.apps.search"
10
45
  verbose_name = "Richie search app"
11
46
 
12
- # pylint: disable=import-outside-toplevel
13
47
  def ready(self):
14
- """Register signals to update the Elasticsearch indices."""
15
- from cms.signals import post_publish, post_unpublish
16
-
17
- from .signals import on_page_published, on_page_unpublished
18
-
19
- post_publish.connect(on_page_published, dispatch_uid="search_post_publish")
20
- post_unpublish.connect(
21
- on_page_unpublished, dispatch_uid="search_post_unpublish"
22
- )
48
+ """
49
+ Initialize the Elasticsearch client and register signals.
50
+ """
51
+ init_es()
52
+ init_signals()
@@ -15,7 +15,7 @@ from cms.api import Page
15
15
 
16
16
  from richie.apps.core.defaults import ALL_LANGUAGES_DICT
17
17
 
18
- from .. import ES_CLIENT
18
+ from ..apps import ES_CLIENT
19
19
  from ..fields.array import ArrayField
20
20
  from ..indexers import ES_INDICES
21
21
  from ..utils.i18n import get_best_field_language
@@ -10,7 +10,7 @@ from django.utils import timezone
10
10
 
11
11
  from elasticsearch.exceptions import NotFoundError, RequestError
12
12
 
13
- from . import ES_CLIENT, ES_INDICES_CLIENT
13
+ from .apps import ES_CLIENT, ES_INDICES_CLIENT
14
14
  from .defaults import ES_CHUNK_SIZE, ES_INDICES_PREFIX
15
15
  from .elasticsearch import bulk_compat
16
16
  from .indexers import ES_INDICES
@@ -7,7 +7,7 @@ from django.utils.translation import get_language_from_request
7
7
  from rest_framework.decorators import action
8
8
  from rest_framework.response import Response
9
9
 
10
- from .. import ES_CLIENT
10
+ from ..apps import ES_CLIENT
11
11
 
12
12
 
13
13
  class ViewSetMetadata:
@@ -11,7 +11,7 @@ from rest_framework.exceptions import NotFound
11
11
  from rest_framework.response import Response
12
12
  from rest_framework.viewsets import ViewSet
13
13
 
14
- from .. import ES_CLIENT
14
+ from ..apps import ES_CLIENT
15
15
  from ..defaults import ES_PAGE_SIZE
16
16
  from ..indexers import ES_INDICES
17
17
  from ..utils.viewsets import ViewSetMetadata
@@ -8,7 +8,7 @@ from elasticsearch.exceptions import NotFoundError
8
8
  from rest_framework.response import Response
9
9
  from rest_framework.viewsets import ViewSet
10
10
 
11
- from .. import ES_CLIENT
11
+ from ..apps import ES_CLIENT
12
12
  from ..defaults import ES_PAGE_SIZE, FILTERS_PRESENTATION
13
13
  from ..filter_definitions import FILTERS
14
14
  from ..indexers import ES_INDICES
@@ -9,7 +9,7 @@ from elasticsearch.exceptions import NotFoundError
9
9
  from rest_framework.response import Response
10
10
  from rest_framework.viewsets import ViewSet
11
11
 
12
- from .. import ES_CLIENT
12
+ from ..apps import ES_CLIENT
13
13
  from ..defaults import ES_PAGE_SIZE
14
14
  from ..indexers import ES_INDICES
15
15
  from ..utils.viewsets import AutocompleteMixin, ViewSetMetadata
@@ -9,7 +9,7 @@ from elasticsearch.exceptions import NotFoundError
9
9
  from rest_framework.response import Response
10
10
  from rest_framework.viewsets import ViewSet
11
11
 
12
- from .. import ES_CLIENT
12
+ from ..apps import ES_CLIENT
13
13
  from ..defaults import ES_PAGE_SIZE
14
14
  from ..indexers import ES_INDICES
15
15
  from ..utils.viewsets import AutocompleteMixin, ViewSetMetadata
@@ -9,7 +9,7 @@ from elasticsearch.exceptions import NotFoundError
9
9
  from rest_framework.response import Response
10
10
  from rest_framework.viewsets import ViewSet
11
11
 
12
- from .. import ES_CLIENT
12
+ from ..apps import ES_CLIENT
13
13
  from ..defaults import ES_PAGE_SIZE
14
14
  from ..indexers import ES_INDICES
15
15
  from ..utils.viewsets import AutocompleteMixin, ViewSetMetadata
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: richie
3
- Version: 3.0.1.dev5
3
+ Version: 3.0.1.dev8
4
4
  Summary: A CMS to build learning portals for open education
5
5
  Author-email: "Open FUN (France Université Numérique)" <fun.dev@fun-mooc.fr>
6
6
  License: MIT License
@@ -1111,15 +1111,15 @@ richie/apps/demo/fixtures/portrait/portrait-8.png,sha256=BvA5je_9wioCgz56GxRIWX9
1111
1111
  richie/apps/demo/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1112
1112
  richie/apps/demo/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1113
1113
  richie/apps/demo/management/commands/create_demo_site.py,sha256=8GdmyHymtPVkN86zmvJ00Lx52F9P1wNNGOIQA_jEJY4,31642
1114
- richie/apps/search/__init__.py,sha256=pSGulmcMEHgv84OVt3RpNAKmw4egImIssH2Q4qebn4A,469
1115
- richie/apps/search/apps.py,sha256=HA1uuHRRtW0LxBIjkcu3iSKI98fHLZwZy_2R9fqtYGQ,742
1114
+ richie/apps/search/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1115
+ richie/apps/search/apps.py,sha256=npt71JLONMn4-BY5pJm8IAlAKZhKqzYC8sCOaCV9phY,1575
1116
1116
  richie/apps/search/cms_toolbars.py,sha256=z7n3QDSPIQks2NvmGRBWd58cbJq0lqEsBJmhK9eTKns,1272
1117
1117
  richie/apps/search/defaults.py,sha256=AvYbKIBXd9z9KeUloEr3Y5DJ1lxch82DmxrG31ncNGo,6004
1118
1118
  richie/apps/search/description.apib,sha256=UPTZaDWUV_U29qLFjHRWumEFPwH97eUbYideboNnot4,9503
1119
1119
  richie/apps/search/elasticsearch.py,sha256=mE20jsQzLnp1VIQ2zntu_UYluECSkmjI2vAEgF60xCA,3811
1120
1120
  richie/apps/search/exceptions.py,sha256=Ld3tYIYJhigNvA_dymZRMQQTYvQmxRTIPbfu37s5K-4,479
1121
1121
  richie/apps/search/forms.py,sha256=4niV0PUZmhz6GwRdN6JT41nRNa4NsNKbgkhZTrT1Fho,15377
1122
- richie/apps/search/index_manager.py,sha256=wMaYcqx34mTFJmN5KsuNHYY0WsTi50YdoT469Y3nDUQ,6324
1122
+ richie/apps/search/index_manager.py,sha256=lSggqzm9qZaujKMTqsWbAchmCkcAHsiZhrlRBMKSseM,6328
1123
1123
  richie/apps/search/models.py,sha256=xJZX2xiPjJlIRwy0eiBFMzBULWnUMgdPTTY3zOzQ0I0,371
1124
1124
  richie/apps/search/signals.py,sha256=waq5ju9F-sdc5_X1YqRpaa78Na7yJK8xt38qEweb9PM,7143
1125
1125
  richie/apps/search/text_indexing.py,sha256=0jFAb1fGJCnUKptW8SYTeS2AdPkEZOmi0Bud3lcHMLc,5647
@@ -1130,7 +1130,7 @@ richie/apps/search/fields/array.py,sha256=Ukfg-viKEZdk3NunS0lqCI2XDMs1lthsK78irS
1130
1130
  richie/apps/search/fields/datetimerange.py,sha256=Fj02Y4B0DVC4amHNaEa9cV7r5hhS0Qb5uQvOOU1NEEA,2500
1131
1131
  richie/apps/search/filter_definitions/__init__.py,sha256=HSRB17H9Y76Y7QpqBuxJZ5a06slxZz-J4h2_KHGY51k,627
1132
1132
  richie/apps/search/filter_definitions/base.py,sha256=YUk8nucv5Ceuvos5mepsyoKZaSrhHfgTwtnUI5x8evE,23513
1133
- richie/apps/search/filter_definitions/courses.py,sha256=4MP_VclNLObRtJSb7s2svzLWJWLFD8VkqgL2tRAQYBY,20317
1133
+ richie/apps/search/filter_definitions/courses.py,sha256=RiQRChczwqROdk8CFVS6ENliUoWwpsuXSmBcpoq6pCc,20321
1134
1134
  richie/apps/search/filter_definitions/helpers.py,sha256=Buyf0EJzYnlM3S8QrPWPhgRhKVL1098g_2J7aHhMYB0,838
1135
1135
  richie/apps/search/filter_definitions/mixins.py,sha256=EEcYVu426reDfeCaeVzNEzj7z40KjPB_yz3FthAIN-c,5669
1136
1136
  richie/apps/search/indexers/__init__.py,sha256=RcrvJGdyUBxcuWY9OnZ2G-G0YEcDb55n3_otj2JqWWg,655
@@ -1146,13 +1146,13 @@ richie/apps/search/templates/search/search.html,sha256=9F8RlGnVGYJh9lIlhlCBMKs44
1146
1146
  richie/apps/search/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1147
1147
  richie/apps/search/utils/i18n.py,sha256=dHIQ362xGFZUOYP8QtjKhP8xIDYTHfDKUHlb8TmRBP8,695
1148
1148
  richie/apps/search/utils/indexers.py,sha256=WCuB1-9GfkRoVaubopKIZDpyH0rW2bpHEZB4eo1_fFU,3107
1149
- richie/apps/search/utils/viewsets.py,sha256=u4OBcT5-nZuKpV0TDC92VWe5jTH0z_C2Au6Is_iAlbU,2907
1149
+ richie/apps/search/utils/viewsets.py,sha256=-khOPIXhjAXCODut31-SnVIsor0lNU5_Sg36dYbhE3Q,2911
1150
1150
  richie/apps/search/viewsets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1151
- richie/apps/search/viewsets/categories.py,sha256=W518jn9DUvIUeOW-vbyE0BsR2iyrNOWUaX67jzkHqU0,5856
1152
- richie/apps/search/viewsets/courses.py,sha256=NPWtfE9B2WmairyUZzbaHdHEfE8ZsFmT-8vQC0w3GcQ,4428
1153
- richie/apps/search/viewsets/licences.py,sha256=qI0XdFbOTrP1OwXQzNAMK8sQTOffdC9XGar9qtB4D9E,3535
1154
- richie/apps/search/viewsets/organizations.py,sha256=iQPAzhsRa5Fl-76cFCp09UcCcsVFPKlauTTGbDDZ_Jg,3636
1155
- richie/apps/search/viewsets/persons.py,sha256=a1_hYkbiBNPuy7wUYzoSP1p963Y_22I3NhB9F9lavbY,3582
1151
+ richie/apps/search/viewsets/categories.py,sha256=zT8NOwmJB3MY33CrOBvvTrtf1LScLjBKmH_DGOQznpQ,5860
1152
+ richie/apps/search/viewsets/courses.py,sha256=1lXueD3jTCAh46JY8jyq9VbnfncuRdLud8Jk7Lz0Bmc,4432
1153
+ richie/apps/search/viewsets/licences.py,sha256=BFoESlgMrl0tR04t_hq1i0d-J0lsLbsplTDypz5EELc,3539
1154
+ richie/apps/search/viewsets/organizations.py,sha256=zfzY6GCFuRG0T7EiU5-Ie7Jl2PgMgo4IzWIURnnAV74,3640
1155
+ richie/apps/search/viewsets/persons.py,sha256=ryfRq4ij6RpfVHSWybyVji9pa7sRAhEbBEz9Y79oGWU,3586
1156
1156
  richie/locale/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
1157
1157
  richie/locale/ar_SA/LC_MESSAGES/django.mo,sha256=n0aFUigovI5AoGVyfs0b2flRA2b_thaZQa0ltKCGXJs,8630
1158
1158
  richie/locale/ar_SA/LC_MESSAGES/django.po,sha256=Equ47JtCDrwW2UVgyqERu8KJR4M2bhSJcFpeavNAIp4,57547
@@ -2483,9 +2483,9 @@ richie/static/richie/js/build/99870.aaea7dc8ccbfbbde731b.index.js,sha256=cpTLUxk
2483
2483
  richie/static/richie/js/build/99895.aaea7dc8ccbfbbde731b.index.js,sha256=ulau6gBdM9fUp02EkaqHqLq74-JKi17lbC5oxfJsgqc,2570
2484
2484
  richie/static/richie/js/build/99953.aaea7dc8ccbfbbde731b.index.js,sha256=OWoLPJnHrmvF3HBQPgXooAGo5E0yJpJ7QTFHFghJpI8,135
2485
2485
  richie/static/richie/js/build/index.js,sha256=4aDGpVam3g1Cluu5vY74Rtk2d6kftkP7CZgSiq8jmMw,1332827
2486
- richie-3.0.1.dev5.dist-info/licenses/LICENSE,sha256=5LKjFIE1kpKzBfR2iwq_RGHhHM5XawdlfZrcHTsCLpA,1079
2487
- richie-3.0.1.dev5.dist-info/METADATA,sha256=EhrcOpQgiH5xyNgNQ0QNoD-BPwwroa34FP49WAq72T0,7030
2488
- richie-3.0.1.dev5.dist-info/WHEEL,sha256=XAkygS4h1cf0JYWV13kJhTWht2y9NqKAsZuiTHc2920,109
2489
- richie-3.0.1.dev5.dist-info/top_level.txt,sha256=WJvFAAHtUQ5T5MOuG6jRynDJG9kVfl4jtuf1qxIXND8,16
2490
- richie-3.0.1.dev5.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2491
- richie-3.0.1.dev5.dist-info/RECORD,,
2486
+ richie-3.0.1.dev8.dist-info/licenses/LICENSE,sha256=5LKjFIE1kpKzBfR2iwq_RGHhHM5XawdlfZrcHTsCLpA,1079
2487
+ richie-3.0.1.dev8.dist-info/METADATA,sha256=PAvMlQSvb4YpoW2cJuWP3f8pP0jmboYt0_FYWXZCSiI,7030
2488
+ richie-3.0.1.dev8.dist-info/WHEEL,sha256=7mLNlhqgufj7fxENZhtzRraBDfDi3AITas5GqZGp0zk,109
2489
+ richie-3.0.1.dev8.dist-info/top_level.txt,sha256=WJvFAAHtUQ5T5MOuG6jRynDJG9kVfl4jtuf1qxIXND8,16
2490
+ richie-3.0.1.dev8.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
2491
+ richie-3.0.1.dev8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.0)
2
+ Generator: setuptools (80.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any