csu 2.6.3__tar.gz → 2.6.5__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.
- {csu-2.6.3 → csu-2.6.5}/.bumpversion.cfg +1 -1
- {csu-2.6.3 → csu-2.6.5}/.cookiecutterrc +1 -1
- {csu-2.6.3 → csu-2.6.5}/PKG-INFO +3 -3
- {csu-2.6.3 → csu-2.6.5}/README.rst +2 -2
- {csu-2.6.3 → csu-2.6.5}/pyproject.toml +1 -1
- {csu-2.6.3 → csu-2.6.5}/src/csu/__init__.py +1 -1
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/serializers.py +1 -1
- {csu-2.6.3 → csu-2.6.5}/src/csu/views.py +15 -10
- {csu-2.6.3 → csu-2.6.5}/src/csu.egg-info/PKG-INFO +3 -3
- {csu-2.6.3 → csu-2.6.5}/.coveragerc +0 -0
- {csu-2.6.3 → csu-2.6.5}/.editorconfig +0 -0
- {csu-2.6.3 → csu-2.6.5}/.github/workflows/github-actions.yml +0 -0
- {csu-2.6.3 → csu-2.6.5}/.pre-commit-config.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/.tombi.toml +0 -0
- {csu-2.6.3 → csu-2.6.5}/AUTHORS.rst +0 -0
- {csu-2.6.3 → csu-2.6.5}/CHANGELOG.rst +0 -0
- {csu-2.6.3 → csu-2.6.5}/CONTRIBUTING.rst +0 -0
- {csu-2.6.3 → csu-2.6.5}/LICENSE +0 -0
- {csu-2.6.3 → csu-2.6.5}/MANIFEST.in +0 -0
- {csu-2.6.3 → csu-2.6.5}/ci/bootstrap.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/ci/requirements.txt +0 -0
- {csu-2.6.3 → csu-2.6.5}/ci/templates/.github/workflows/github-actions.yml +0 -0
- {csu-2.6.3 → csu-2.6.5}/pytest.ini +0 -0
- {csu-2.6.3 → csu-2.6.5}/setup.cfg +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/admin.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/conf.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/consts.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/__init__.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/auth.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/fields.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/forms.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/perms.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/phonenumber.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/test_auth.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/test_fields.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/test_forms.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/test_phonenumber.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/test_serializers.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/drf/views.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/enums.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/env.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/exceptions.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/export.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/fixups.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/forms/__init__.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/forms/crispy.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/forms/fields.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/gettext.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/gettext_lazy.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/locale/ro/LC_MESSAGES/django.mo +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/locale/ro/LC_MESSAGES/django.po +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/logging.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/management.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/models.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/query.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/routers.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/service.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/templates/api_exception.html +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/templates/forms/widgets/opaquewidget.html +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/test_consts.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/test_env.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/test_exceptions.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/test_management.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/test_service.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/test_timezones.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/test_utils.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/test_xml.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/timezones.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/utils.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/worker/__init__.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/worker/admin.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/worker/asgi.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/worker/engine.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/worker/enums.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/worker/job.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/worker/models.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/worker/registry.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/wsgi.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu/xml.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu.egg-info/SOURCES.txt +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu.egg-info/dependency_links.txt +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu.egg-info/requires.txt +0 -0
- {csu-2.6.3 → csu-2.6.5}/src/csu.egg-info/top_level.txt +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/cassettes/test_service/test_custom_context.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/cassettes/test_service/test_custom_context_0_retries.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/cassettes/test_service/test_decoding.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/cassettes/test_service/test_error.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/cassettes/test_service/test_logging.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/cassettes/test_service/test_redirects.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/cassettes/test_service_auth/test_async.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/cassettes/test_service_auth/test_async_auth.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/cassettes/test_service_auth/test_sync.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/cassettes/test_service_auth/test_sync_auth.yaml +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/conftest.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/exampleworker.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/test_exampleworker.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/test_logging.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/test_models.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/test_service.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/test_service_auth.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/test_views.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/test_worker.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/testproject/__init__.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/testproject/fixtures/testuser.json +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/testproject/models.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/testproject/settings.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tests/testproject/urls.py +0 -0
- {csu-2.6.3 → csu-2.6.5}/tox.ini +0 -0
{csu-2.6.3 → csu-2.6.5}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: csu
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.5
|
|
4
4
|
Summary: Clean Slate Utils - bunch of utility code, mostly Django/DRF specific.
|
|
5
5
|
Author-email: Ionel Cristian Mărieș <contact@ionelmc.ro>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -69,9 +69,9 @@ Overview
|
|
|
69
69
|
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/csu.svg
|
|
70
70
|
:alt: Supported implementations
|
|
71
71
|
:target: https://pypi.org/project/csu
|
|
72
|
-
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.
|
|
72
|
+
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.5.svg
|
|
73
73
|
:alt: Commits since latest release
|
|
74
|
-
:target: https://github.com/ionelmc/python-csu/compare/v2.6.
|
|
74
|
+
:target: https://github.com/ionelmc/python-csu/compare/v2.6.5...main
|
|
75
75
|
.. |scrutinizer| image:: https://img.shields.io/scrutinizer/quality/g/ionelmc/python-csu/main.svg
|
|
76
76
|
:alt: Scrutinizer Status
|
|
77
77
|
:target: https://scrutinizer-ci.com/g/ionelmc/python-csu/
|
|
@@ -34,9 +34,9 @@ Overview
|
|
|
34
34
|
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/csu.svg
|
|
35
35
|
:alt: Supported implementations
|
|
36
36
|
:target: https://pypi.org/project/csu
|
|
37
|
-
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.
|
|
37
|
+
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.5.svg
|
|
38
38
|
:alt: Commits since latest release
|
|
39
|
-
:target: https://github.com/ionelmc/python-csu/compare/v2.6.
|
|
39
|
+
:target: https://github.com/ionelmc/python-csu/compare/v2.6.5...main
|
|
40
40
|
.. |scrutinizer| image:: https://img.shields.io/scrutinizer/quality/g/ionelmc/python-csu/main.svg
|
|
41
41
|
:alt: Scrutinizer Status
|
|
42
42
|
:target: https://scrutinizer-ci.com/g/ionelmc/python-csu/
|
|
@@ -96,7 +96,7 @@ class ConfirmSerializer(Serializer):
|
|
|
96
96
|
else:
|
|
97
97
|
raise ValidationError({"confirm": _("Confirm time limit expired.")})
|
|
98
98
|
else:
|
|
99
|
-
status_repr = repr(type(instance).status_enum_class(instance.status))
|
|
99
|
+
status_repr = repr(type(instance).status_enum_class(instance.status).name)
|
|
100
100
|
raise ValidationError({"confirm": _("Cannot confirm when status is {status}.").format(status=status_repr)})
|
|
101
101
|
|
|
102
102
|
|
|
@@ -79,7 +79,9 @@ def exception_handler(
|
|
|
79
79
|
event_id_field="accident_id",
|
|
80
80
|
message_field="detail",
|
|
81
81
|
error_error_code_field="code",
|
|
82
|
-
|
|
82
|
+
rollback_transaction=True,
|
|
83
|
+
build_response=True,
|
|
84
|
+
) -> Response | None:
|
|
83
85
|
"""
|
|
84
86
|
Returns the response that should be used for any given exception.
|
|
85
87
|
|
|
@@ -106,6 +108,7 @@ def exception_handler(
|
|
|
106
108
|
if auth_header := getattr(exc, "auth_header", None):
|
|
107
109
|
headers["WWW-Authenticate"] = auth_header
|
|
108
110
|
if wait := getattr(exc, "wait", None):
|
|
111
|
+
assert isinstance(wait, int), f"Expected exc.wait={wait=!r} to be int!"
|
|
109
112
|
headers["Retry-After"] = f"{wait:d}"
|
|
110
113
|
status_code = exc.status_code
|
|
111
114
|
else:
|
|
@@ -154,15 +157,17 @@ def exception_handler(
|
|
|
154
157
|
exc_info=True,
|
|
155
158
|
extra={"csu_exc": True},
|
|
156
159
|
)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
accepted_renderer =
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
if rollback_transaction:
|
|
161
|
+
set_rollback()
|
|
162
|
+
if build_response:
|
|
163
|
+
response = Response(data, status=status_code, headers=headers)
|
|
164
|
+
accepted_renderer = getattr(request, "accepted_renderer", None)
|
|
165
|
+
if not accepted_renderer:
|
|
166
|
+
accepted_renderer = JSONRenderer()
|
|
167
|
+
response.accepted_renderer = accepted_renderer
|
|
168
|
+
response.accepted_media_type = accepted_renderer.media_type
|
|
169
|
+
response.renderer_context = context
|
|
170
|
+
return response
|
|
166
171
|
|
|
167
172
|
|
|
168
173
|
def server_error(request, *args, **kwargs):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: csu
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.5
|
|
4
4
|
Summary: Clean Slate Utils - bunch of utility code, mostly Django/DRF specific.
|
|
5
5
|
Author-email: Ionel Cristian Mărieș <contact@ionelmc.ro>
|
|
6
6
|
License-Expression: BSD-2-Clause
|
|
@@ -69,9 +69,9 @@ Overview
|
|
|
69
69
|
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/csu.svg
|
|
70
70
|
:alt: Supported implementations
|
|
71
71
|
:target: https://pypi.org/project/csu
|
|
72
|
-
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.
|
|
72
|
+
.. |commits-since| image:: https://img.shields.io/github/commits-since/ionelmc/python-csu/v2.6.5.svg
|
|
73
73
|
:alt: Commits since latest release
|
|
74
|
-
:target: https://github.com/ionelmc/python-csu/compare/v2.6.
|
|
74
|
+
:target: https://github.com/ionelmc/python-csu/compare/v2.6.5...main
|
|
75
75
|
.. |scrutinizer| image:: https://img.shields.io/scrutinizer/quality/g/ionelmc/python-csu/main.svg
|
|
76
76
|
:alt: Scrutinizer Status
|
|
77
77
|
:target: https://scrutinizer-ci.com/g/ionelmc/python-csu/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{csu-2.6.3 → csu-2.6.5}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{csu-2.6.3 → csu-2.6.5}/tox.ini
RENAMED
|
File without changes
|