openedx-learning 0.18.0__py2.py3-none-any.whl → 0.18.2__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.
@@ -2,4 +2,4 @@
2
2
  Open edX Learning ("Learning Core").
3
3
  """
4
4
 
5
- __version__ = "0.18.0"
5
+ __version__ = "0.18.2"
@@ -267,11 +267,7 @@ class Content(models.Model):
267
267
  # only in file form. It is an error for ``text`` to be None and ``has_file``
268
268
  # to be False, since that would mean we haven't stored data anywhere at all.
269
269
  #
270
- # We annotate this because mypy doesn't recognize that ``text`` should be
271
- # nullable when using MultiCollationTextField, but does the right thing for
272
- # TextField. For more info, see:
273
- # https://github.com/openedx/openedx-learning/issues/152
274
- text: models.TextField[str | None, str | None] = MultiCollationTextField(
270
+ text = MultiCollationTextField(
275
271
  blank=True,
276
272
  null=True,
277
273
  max_length=MAX_TEXT_LENGTH,
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: openedx-learning
3
- Version: 0.18.0
3
+ Version: 0.18.2
4
4
  Summary: Open edX Learning Core and Tagging.
5
5
  Home-page: https://github.com/openedx/openedx-learning
6
6
  Author: David Ormsbee
@@ -19,11 +19,21 @@ Classifier: Programming Language :: Python :: 3.12
19
19
  Requires-Python: >=3.11
20
20
  License-File: LICENSE.txt
21
21
  Requires-Dist: attrs
22
- Requires-Dist: rules<4.0
23
- Requires-Dist: Django<5.0
24
- Requires-Dist: djangorestframework<4.0
25
22
  Requires-Dist: edx-drf-extensions
23
+ Requires-Dist: Django<5.0
24
+ Requires-Dist: rules<4.0
26
25
  Requires-Dist: celery
26
+ Requires-Dist: djangorestframework<4.0
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: home-page
32
+ Dynamic: keywords
33
+ Dynamic: license
34
+ Dynamic: requires-dist
35
+ Dynamic: requires-python
36
+ Dynamic: summary
27
37
 
28
38
  Open edX Learning Core (and Tagging)
29
39
  ====================================
@@ -1,4 +1,4 @@
1
- openedx_learning/__init__.py,sha256=WQCJfrV8nUpwAaGx2NCUAw0d22YgqZqryjy0wIiV01M,69
1
+ openedx_learning/__init__.py,sha256=ocvzmbOu6mnDbotyVVaqxa7N5_X4KLXhFm24TGgt7Ug,69
2
2
  openedx_learning/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  openedx_learning/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  openedx_learning/api/authoring.py,sha256=vbRpiQ2wOfN3oR2bbN0-bI2ra0QRtha9tVixKW1ENis,929
@@ -32,7 +32,7 @@ openedx_learning/apps/authoring/contents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
32
32
  openedx_learning/apps/authoring/contents/admin.py,sha256=9Njd_lje1emcd168KBWUTGf0mVJ6K-dMYMcqHNjRU4k,1761
33
33
  openedx_learning/apps/authoring/contents/api.py,sha256=bXb9yQjPfoP1Ynf1aAYz3BEPffK7H5cnba6KdPFSiG0,8818
34
34
  openedx_learning/apps/authoring/contents/apps.py,sha256=EEUZEnww7TcYcyxMovZthG2muNxd7j7nxBIf21gKrp4,398
35
- openedx_learning/apps/authoring/contents/models.py,sha256=RobNGdqkFhChcpub9FszOeqft4c1TJQgS5vQ3Cp2NCA,17899
35
+ openedx_learning/apps/authoring/contents/models.py,sha256=AG3U00TPEjshngBdBhC_qCTF_dPcQMEmjmzW9pjA4BU,17599
36
36
  openedx_learning/apps/authoring/contents/migrations/0001_initial.py,sha256=FtOTmIGX2KHpjw-PHbfRjxkFEomI5CEDhNKCZ7IpFeE,3060
37
37
  openedx_learning/apps/authoring/contents/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  openedx_learning/apps/authoring/publishing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -108,12 +108,12 @@ openedx_tagging/core/tagging/rest_api/urls.py,sha256=egXaRQv1EAgF04ThgVZBQuvLK1L
108
108
  openedx_tagging/core/tagging/rest_api/utils.py,sha256=XZXixZ44vpNlxiyFplW8Lktyh_m1EfR3Y-tnyvA7acc,3620
109
109
  openedx_tagging/core/tagging/rest_api/v1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
110
110
  openedx_tagging/core/tagging/rest_api/v1/permissions.py,sha256=7HPE_NuKku_ISnkeE_HsFNXVYt0IbVkJN6M4wqwHGHU,2443
111
- openedx_tagging/core/tagging/rest_api/v1/serializers.py,sha256=D7brBbgmU7MnbU7Ln_xiLG-TtXno0aciE5AhjsXlClE,13903
111
+ openedx_tagging/core/tagging/rest_api/v1/serializers.py,sha256=0HQD_Jrf6-YpocYfzGs74YBYjXe9Yo7cXU0A4VKr5Dw,13876
112
112
  openedx_tagging/core/tagging/rest_api/v1/urls.py,sha256=dNUKCtUCx_YzrwlbEbpDfjGVQbb2QdJ1VuJCkladj6E,752
113
- openedx_tagging/core/tagging/rest_api/v1/views.py,sha256=LA0EF7-p91JgVrLZpZaG474elKD1dswODGvoPIw47Mg,35837
113
+ openedx_tagging/core/tagging/rest_api/v1/views.py,sha256=Hf92cy-tE767DE9FgsZcPKiCYrf5ihfETz8qGKBnuiU,36278
114
114
  openedx_tagging/core/tagging/rest_api/v1/views_import.py,sha256=kbHUPe5A6WaaJ3J1lFIcYCt876ecLNQfd19m7YYub6c,1470
115
- openedx_learning-0.18.0.dist-info/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
116
- openedx_learning-0.18.0.dist-info/METADATA,sha256=0TzunzFQsdhZ0vYpqBy0XCsW02pFP0mACyskAekcA4w,8777
117
- openedx_learning-0.18.0.dist-info/WHEEL,sha256=OpXWERl2xLPRHTvd2ZXo_iluPEQd8uSbYkJ53NAER_Y,109
118
- openedx_learning-0.18.0.dist-info/top_level.txt,sha256=IYFbr5mgiEHd-LOtZmXj3q3a0bkGK1M9LY7GXgnfi4M,33
119
- openedx_learning-0.18.0.dist-info/RECORD,,
115
+ openedx_learning-0.18.2.dist-info/LICENSE.txt,sha256=QTW2QN7q3XszgUAXm9Dzgtu5LXYKbR1SGnqMa7ufEuY,35139
116
+ openedx_learning-0.18.2.dist-info/METADATA,sha256=Bcxh5QoGBtnf43eCBqqe8i3JryQAALdsaLT0dw82XnY,8975
117
+ openedx_learning-0.18.2.dist-info/WHEEL,sha256=9Hm2OB-j1QcCUq9Jguht7ayGIIZBRTdOXD1qg9cCgPM,109
118
+ openedx_learning-0.18.2.dist-info/top_level.txt,sha256=IYFbr5mgiEHd-LOtZmXj3q3a0bkGK1M9LY7GXgnfi4M,33
119
+ openedx_learning-0.18.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any
@@ -157,8 +157,7 @@ class ObjectTagSerializer(ObjectTagMinimalSerializer):
157
157
  class Meta:
158
158
  model = ObjectTag
159
159
  fields = ObjectTagMinimalSerializer.Meta.fields + [
160
- # The taxonomy name
161
- "name",
160
+ "export_id",
162
161
  "taxonomy_id",
163
162
  # If the Tag or Taxonomy has been deleted, this ObjectTag shouldn't be shown to users.
164
163
  "is_deleted",
@@ -450,6 +450,7 @@ class ObjectTagView(
450
450
  minimal_serializer_class = ObjectTagMinimalSerializer
451
451
  permission_classes = [ObjectTagObjectPermissions]
452
452
  lookup_field = "object_id"
453
+ lookup_value_regex = r'[\w\.\+\-@:]+'
453
454
 
454
455
  def get_queryset(self) -> models.QuerySet:
455
456
  """
@@ -619,6 +620,7 @@ class ObjectTagCountsView(
619
620
 
620
621
  serializer_class = ObjectTagSerializer
621
622
  lookup_field = "object_id_pattern"
623
+ lookup_value_regex = r'[\w\.\+\-@:*,]+'
622
624
 
623
625
  def retrieve(self, request, *args, **kwargs) -> Response:
624
626
  """
@@ -780,8 +782,8 @@ class TaxonomyTagsView(ListAPIView, RetrieveUpdateDestroyAPIView):
780
782
  The current taxonomy is cached in the view.
781
783
  """
782
784
  if not self._taxonomy:
783
- taxonomy_id = int(self.kwargs["pk"])
784
- taxonomy = get_taxonomy(taxonomy_id)
785
+ taxonomy_id = self.kwargs.get("pk")
786
+ taxonomy = get_taxonomy(int(taxonomy_id)) if taxonomy_id else None
785
787
  if not taxonomy:
786
788
  raise Http404("Taxonomy not found")
787
789
  self.check_object_permissions(self.request, taxonomy)
@@ -797,6 +799,9 @@ class TaxonomyTagsView(ListAPIView, RetrieveUpdateDestroyAPIView):
797
799
  context['request'] = self.request
798
800
  serializer = self.serializer_class(self, context=context)
799
801
 
802
+ if getattr(self, 'swagger_fake_view', False):
803
+ # queryset just for schema generation metadata
804
+ return context
800
805
  # Instead of checking permissions for each TagData instance, we just check them once for the whole taxonomy
801
806
  # (since that's currently how our rules work). This might change if Tag-specific permissions are needed.
802
807
  taxonomy = self.get_taxonomy()
@@ -812,6 +817,9 @@ class TaxonomyTagsView(ListAPIView, RetrieveUpdateDestroyAPIView):
812
817
  """
813
818
  Builds and returns the queryset to be paginated.
814
819
  """
820
+ if getattr(self, 'swagger_fake_view', False):
821
+ # queryset just for schema generation metadata
822
+ return Taxonomy.objects.none() # type: ignore[return-value]
815
823
  taxonomy = self.get_taxonomy()
816
824
  parent_tag_value = self.request.query_params.get("parent_tag", None)
817
825
  include_counts = "include_counts" in self.request.query_params