learning-credentials 0.5.1rc4__tar.gz → 0.5.2__tar.gz

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.
Files changed (58) hide show
  1. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/CHANGELOG.rst +13 -0
  2. {learning_credentials-0.5.1rc4/learning_credentials.egg-info → learning_credentials-0.5.2}/PKG-INFO +14 -1
  3. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/admin.py +3 -2
  4. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/api/v1/views.py +8 -1
  5. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/generators.py +1 -1
  6. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/processors.py +5 -5
  7. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2/learning_credentials.egg-info}/PKG-INFO +14 -1
  8. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/pyproject.toml +1 -1
  9. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/tests/test_generators.py +1 -1
  10. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/LICENSE.txt +0 -0
  11. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/MANIFEST.in +0 -0
  12. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/README.rst +0 -0
  13. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/__init__.py +0 -0
  14. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/api/__init__.py +0 -0
  15. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/api/urls.py +0 -0
  16. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/api/v1/__init__.py +0 -0
  17. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/api/v1/permissions.py +0 -0
  18. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/api/v1/serializers.py +0 -0
  19. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/api/v1/urls.py +0 -0
  20. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/apps.py +0 -0
  21. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/compat.py +0 -0
  22. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/conf/locale/config.yaml +0 -0
  23. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/exceptions.py +0 -0
  24. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/0001_initial.py +0 -0
  25. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/0002_migrate_to_learning_credentials.py +0 -0
  26. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/0003_rename_certificates_to_credentials.py +0 -0
  27. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/0004_replace_course_keys_with_learning_context_keys.py +0 -0
  28. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/0005_rename_processors_and_generators.py +0 -0
  29. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/0006_cleanup_openedx_certificates_tables.py +0 -0
  30. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/0007_migrate_to_text_elements_format.py +0 -0
  31. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/0008_validation.py +0 -0
  32. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/0009_credential_user_fk.py +0 -0
  33. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/0010_credential_configuration_fk.py +0 -0
  34. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/migrations/__init__.py +0 -0
  35. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/models.py +0 -0
  36. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/settings/__init__.py +0 -0
  37. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/settings/common.py +0 -0
  38. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/settings/production.py +0 -0
  39. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/tasks.py +0 -0
  40. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/templates/learning_credentials/base.html +0 -0
  41. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/templates/learning_credentials/edx_ace/certificate_generated/email/body.html +0 -0
  42. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/templates/learning_credentials/edx_ace/certificate_generated/email/body.txt +0 -0
  43. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/templates/learning_credentials/edx_ace/certificate_generated/email/from_name.txt +0 -0
  44. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/templates/learning_credentials/edx_ace/certificate_generated/email/head.html +0 -0
  45. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/templates/learning_credentials/edx_ace/certificate_generated/email/subject.txt +0 -0
  46. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials/urls.py +0 -0
  47. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials.egg-info/SOURCES.txt +0 -0
  48. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials.egg-info/dependency_links.txt +0 -0
  49. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials.egg-info/entry_points.txt +0 -0
  50. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials.egg-info/requires.txt +0 -0
  51. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/learning_credentials.egg-info/top_level.txt +0 -0
  52. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/setup.cfg +0 -0
  53. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/tests/test_admin.py +0 -0
  54. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/tests/test_migrations.py +0 -0
  55. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/tests/test_models.py +0 -0
  56. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/tests/test_processors.py +0 -0
  57. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/tests/test_tasks.py +0 -0
  58. {learning_credentials-0.5.1rc4 → learning_credentials-0.5.2}/tests/test_views.py +0 -0
@@ -16,6 +16,19 @@ Unreleased
16
16
 
17
17
  *
18
18
 
19
+ 0.5.2 - 2026-08-11
20
+ ******************
21
+
22
+ Changed
23
+ =======
24
+
25
+ * The ``CredentialAdmin`` list view is now ordered by the ``created`` timestamp in descending order (most recent first).
26
+
27
+ Removed
28
+ =======
29
+
30
+ * ``CredentialAdmin`` and ``CredentialConfigurationAdmin`` list views no longer allow filtering by the ``learning_context_key``.
31
+
19
32
  0.5.1 - 2026-03-17
20
33
  ******************
21
34
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: learning-credentials
3
- Version: 0.5.1rc4
3
+ Version: 0.5.2
4
4
  Summary: A pluggable service for preparing Open edX credentials.
5
5
  Author-email: OpenCraft <help@opencraft.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -177,6 +177,19 @@ Unreleased
177
177
 
178
178
  *
179
179
 
180
+ 0.5.2 - 2026-08-11
181
+ ******************
182
+
183
+ Changed
184
+ =======
185
+
186
+ * The ``CredentialAdmin`` list view is now ordered by the ``created`` timestamp in descending order (most recent first).
187
+
188
+ Removed
189
+ =======
190
+
191
+ * ``CredentialAdmin`` and ``CredentialConfigurationAdmin`` list views no longer allow filtering by the ``learning_context_key``.
192
+
180
193
  0.5.1 - 2026-03-17
181
194
  ******************
182
195
 
@@ -177,7 +177,7 @@ class CredentialConfigurationAdmin(DjangoObjectActions, ReverseModelAdmin):
177
177
  ]
178
178
  list_display = ('learning_context_key', 'credential_type', 'enabled', 'interval')
179
179
  search_fields = ('learning_context_key', 'credential_type__name')
180
- list_filter = ('learning_context_key', 'credential_type')
180
+ list_filter = ('credential_type', 'periodic_task__enabled')
181
181
 
182
182
  def get_inline_instances(
183
183
  self,
@@ -260,7 +260,8 @@ class CredentialAdmin(DjangoObjectActions, admin.ModelAdmin): # noqa: D101
260
260
  "uuid",
261
261
  "verify_uuid",
262
262
  )
263
- list_filter = ("configuration__learning_context_key", "configuration__credential_type", "status")
263
+ list_filter = ("configuration__credential_type", "status")
264
+ ordering = ('-created',)
264
265
  change_actions = ('reissue_credential',)
265
266
 
266
267
  def get_change_actions(self, request: HttpRequest, object_id: str, form_url: str) -> list[str]:
@@ -151,7 +151,6 @@ class CredentialEligibilityView(APIView):
151
151
  API view for credential eligibility checking and generation.
152
152
 
153
153
  **GET**: Returns detailed eligibility info for all configured credentials in a learning context.
154
- **POST**: Triggers credential generation for an eligible user.
155
154
 
156
155
  Staff users can operate on behalf of other users via the ``username`` parameter.
157
156
  """
@@ -192,6 +191,14 @@ class CredentialEligibilityView(APIView):
192
191
  "(e.g. learning_credentials.processors.retrieve_subsection_grades)."
193
192
  ),
194
193
  ),
194
+ apidocs.string_parameter(
195
+ "username",
196
+ ParameterLocation.QUERY,
197
+ description=(
198
+ "Operate on behalf of the specified user. "
199
+ "Staff users may specify any username; non-staff users are limited to their own."
200
+ ),
201
+ ),
195
202
  ],
196
203
  responses={
197
204
  200: CredentialEligibilityResponseSerializer,
@@ -236,7 +236,7 @@ def _render_text_element(
236
236
  pdf_canvas.drawString(line_x, line_y, line, charSpace=char_space)
237
237
 
238
238
 
239
- def _write_text_on_template( # noqa: PLR0913
239
+ def _write_text_on_template( # noqa: PLR0913,PLR0917
240
240
  template: PageObject,
241
241
  username: str,
242
242
  context_name: str,
@@ -1,11 +1,11 @@
1
1
  """
2
2
  This module contains processors for credential criteria.
3
3
 
4
- The functions prefixed with `retrieve_` are automatically detected by the admin page and are used to retrieve the
5
- IDs of the users that meet the criteria for the credential type.
4
+ The functions prefixed with `retrieve_` are automatically detected by the admin page and are used to compute
5
+ per-user progress for the credential type, following the contract described below.
6
6
 
7
- All processors return ``dict[int, dict[str, Any]]`` — a mapping from user ID to detailed progress info.
8
- Each user's dict always includes an ``is_eligible`` boolean.
7
+ All processors return ``dict[int, dict[str, Any]]`` — a mapping from user ID to detailed progress info for all
8
+ relevant users, including those who are not eligible. Each user's dict always includes an ``is_eligible`` boolean.
9
9
 
10
10
  We will move this module to an external repository (a plugin).
11
11
  """
@@ -214,7 +214,7 @@ def _retrieve_course_subsection_grades(
214
214
  course_id: CourseKey, options: dict[str, Any], user_id: int | None = None
215
215
  ) -> dict[int, dict[str, Any]]:
216
216
  """Retrieve detailed grade progress for enrolled users in a course."""
217
- required_grades: dict[str, int] = options['required_grades']
217
+ required_grades: dict[str, float] = options['required_grades']
218
218
  required_grades = {key.lower(): value * 100 for key, value in required_grades.items()}
219
219
 
220
220
  users = get_course_enrollments(course_id, user_id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: learning-credentials
3
- Version: 0.5.1rc4
3
+ Version: 0.5.2
4
4
  Summary: A pluggable service for preparing Open edX credentials.
5
5
  Author-email: OpenCraft <help@opencraft.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -177,6 +177,19 @@ Unreleased
177
177
 
178
178
  *
179
179
 
180
+ 0.5.2 - 2026-08-11
181
+ ******************
182
+
183
+ Changed
184
+ =======
185
+
186
+ * The ``CredentialAdmin`` list view is now ordered by the ``created`` timestamp in descending order (most recent first).
187
+
188
+ Removed
189
+ =======
190
+
191
+ * ``CredentialAdmin`` and ``CredentialConfigurationAdmin`` list views no longer allow filtering by the ``learning_context_key``.
192
+
180
193
  0.5.1 - 2026-03-17
181
194
  ******************
182
195
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "learning-credentials"
3
- version = "0.5.1rc4"
3
+ version = "0.5.2"
4
4
  description = "A pluggable service for preparing Open edX credentials."
5
5
  dynamic = ["readme"]
6
6
  requires-python = ">=3.11"
@@ -504,7 +504,7 @@ def test_save_credential(mock_contentfile: Mock, mock_token_hex: Mock, storage:
504
504
  return_value=Mock(getpdfdata=Mock(return_value=b'pdf_data')),
505
505
  )
506
506
  @patch('learning_credentials.generators._save_credential', return_value='credential_url')
507
- def test_generate_pdf_credential(
507
+ def test_generate_pdf_credential( # noqa: PLR0917
508
508
  mock_save_credential: Mock,
509
509
  mock_write_text_on_template: Mock,
510
510
  mock_pdf_writer: Mock,