clinicedc 2.0.29__py3-none-any.whl → 2.0.31__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 clinicedc might be problematic. Click here for more details.
- {clinicedc-2.0.29.dist-info → clinicedc-2.0.31.dist-info}/METADATA +1 -1
- {clinicedc-2.0.29.dist-info → clinicedc-2.0.31.dist-info}/RECORD +11 -11
- edc_auth/utils.py +1 -1
- edc_dashboard/view_mixins/edc_view_mixin.py +1 -1
- edc_model_admin/dashboard/model_admin_dashboard_mixin.py +9 -5
- edc_model_admin/mixins/model_admin_next_url_redirect_mixin.py +3 -3
- edc_model_admin/mixins/model_admin_redirect_on_delete_mixin.py +6 -8
- edc_model_admin/mixins/templates_model_admin_mixin.py +1 -1
- edc_sites/admin/site_model_admin_mixin.py +2 -2
- {clinicedc-2.0.29.dist-info → clinicedc-2.0.31.dist-info}/WHEEL +0 -0
- {clinicedc-2.0.29.dist-info → clinicedc-2.0.31.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: clinicedc
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.31
|
|
4
4
|
Summary: A clinical trials data management framework built on Django
|
|
5
5
|
Keywords: django,clinicedc,edc,clinical trials,research,data management,esource
|
|
6
6
|
Author: Erik van Widenfelt, Jonathan Willitts
|
|
@@ -541,7 +541,7 @@ edc_auth/templates/edc_auth/user_country_sites.html,sha256=w80_iBOBC18bgLwbZGSIp
|
|
|
541
541
|
edc_auth/templates/edc_auth/user_role_description.html,sha256=M60vmcNNXU8Ao9iDzehViOu0gtG6J1471KZobY7i7VE,355
|
|
542
542
|
edc_auth/urls.py,sha256=vmK4aRoj82WZQ5iytGR9dU0lRWlbZMMJo7cHPWJusb4,284
|
|
543
543
|
edc_auth/urls_for_accounts.py,sha256=W0-bYieN6Gwhji6pxwQrL4QGRBGpzINs8eByQvh53qc,1701
|
|
544
|
-
edc_auth/utils.py,sha256=
|
|
544
|
+
edc_auth/utils.py,sha256=aVwSyV9DJARMof8lSgjPW-ZX2rQ-kzB7yqVtvlWaqec,4355
|
|
545
545
|
edc_auth/views.py,sha256=6WqgrX-wm3khDZc2GZgOaAyIjsWkMc5s7JVKylYTmX4,2168
|
|
546
546
|
edc_consent/__init__.py,sha256=f4XklvchXWl2ktKYORrapK0BPHtdLXZqZhfy54PvF_w,41
|
|
547
547
|
edc_consent/actions.py,sha256=-Rx8ZHn_uv0xQElJhjBmPC3lPVOOskC1om7KSVWWJqk,1984
|
|
@@ -731,7 +731,7 @@ edc_dashboard/urls.py,sha256=EoLK8OiZa9PeEuZOHQSRvJXwc7hS9vzm_uqyvZtXCIQ,161
|
|
|
731
731
|
edc_dashboard/utils.py,sha256=iGVPtEUXzG5_MU5SvgjbA5qQ4aZOF226ENpApAB5Xg4,1447
|
|
732
732
|
edc_dashboard/view_mixins/__init__.py,sha256=B7ZVw0KOZ0cPkJRv40r0jG3Nwyb2uUjDbjz-e4JKT7o,287
|
|
733
733
|
edc_dashboard/view_mixins/administration_view_mixin.py,sha256=6kubyQ3UuPYCf2A3bt9XH33EUGu8zRoLRZYiHMFOXVA,3671
|
|
734
|
-
edc_dashboard/view_mixins/edc_view_mixin.py,sha256=
|
|
734
|
+
edc_dashboard/view_mixins/edc_view_mixin.py,sha256=ky3dBhkNY3NGFlk7Z4_y2g3u9FZjjQTZEWIJxR-QQ8s,2971
|
|
735
735
|
edc_dashboard/view_mixins/message_view_mixin.py,sha256=09qg6KcpUvd8jb0z9I7665O82-TvsYsTrG8k0GbQOdM,1420
|
|
736
736
|
edc_dashboard/view_mixins/template_request_context_mixin.py,sha256=NMvboUNf0L23QRYgaXXH9Na6ZGgsymuEp_LB3rt59AU,1013
|
|
737
737
|
edc_dashboard/view_mixins/url_request_context_mixin.py,sha256=KynhaGsRzsquvtxXN1oqK3cNWto6oF3nZMM5HJCDGus,2116
|
|
@@ -1878,7 +1878,7 @@ edc_model_admin/changelist_buttons/model_admin_changelist_model_button_mixin.py,
|
|
|
1878
1878
|
edc_model_admin/context_processors.py,sha256=5Xx06ZOz47OythCBSQa7518kzkJ6Heb_IiOhPPYrkv0,842
|
|
1879
1879
|
edc_model_admin/dashboard/__init__.py,sha256=MJL3b7UQ86cPDhxH2A8cKj4rC3DkPDDWTunZcdXavRM,295
|
|
1880
1880
|
edc_model_admin/dashboard/model_admin_crf_dashboard_mixin.py,sha256=LcC6EFUmCg4J0ifggtZ7GvmrON_e1Sv_cOUJoaPwrH4,1339
|
|
1881
|
-
edc_model_admin/dashboard/model_admin_dashboard_mixin.py,sha256=
|
|
1881
|
+
edc_model_admin/dashboard/model_admin_dashboard_mixin.py,sha256=IWdCLQuqU3hRMBE4iIxUxdlLjm66sOwewC8S9fFpVZE,3737
|
|
1882
1882
|
edc_model_admin/dashboard/model_admin_stacked_inline_mixin.py,sha256=tBe2A8t_YfNtTasZvc3X8-PWPiTtcOMoBoxZHxa4gzc,807
|
|
1883
1883
|
edc_model_admin/dashboard/model_admin_subject_dashboard_mixin.py,sha256=WqCcc1QE7iAsF6WJSVQzoUw000JHjWt9Gz49cjosPbY,1996
|
|
1884
1884
|
edc_model_admin/history/__init__.py,sha256=mpNejmXJJgBAO8cNWezALB4ewLw2aJ3_I4ks-p6A2MM,59
|
|
@@ -1905,12 +1905,12 @@ edc_model_admin/mixins/model_admin_hide_delete_button_on_condition.py,sha256=KHZ
|
|
|
1905
1905
|
edc_model_admin/mixins/model_admin_institution_mixin.py,sha256=iqWFcHqZVyTICbfL_SLXRTC1NI97lfcLonK_hV_eQdM,150
|
|
1906
1906
|
edc_model_admin/mixins/model_admin_limit_to_selected_foreignkey.py,sha256=I2BnfcJfNa-UosdLObFMcD451-lmwbzwcZ_iAdjvA3s,1245
|
|
1907
1907
|
edc_model_admin/mixins/model_admin_model_redirect_mixin.py,sha256=Io2pjDp_BAtdaUY0Rks_qIvq-yx0wnxEbLZTioGZyh4,1397
|
|
1908
|
-
edc_model_admin/mixins/model_admin_next_url_redirect_mixin.py,sha256=
|
|
1908
|
+
edc_model_admin/mixins/model_admin_next_url_redirect_mixin.py,sha256=InQJdNWJKeWX2Q2cpRFUfFdCPb2iVqCRBtmrI0xzbeY,7004
|
|
1909
1909
|
edc_model_admin/mixins/model_admin_protect_pii_mixin.py,sha256=_Hm1VI3lfGPl7_fnr7nuruBA1ZevSVeOgljTwsWrj0c,2690
|
|
1910
1910
|
edc_model_admin/mixins/model_admin_redirect_all_to_changelist_mixin.py,sha256=r6ukCJcJSMy365VjN32tdx5gZx7aqUqn8Xm7My0QuRY,2861
|
|
1911
|
-
edc_model_admin/mixins/model_admin_redirect_on_delete_mixin.py,sha256=
|
|
1911
|
+
edc_model_admin/mixins/model_admin_redirect_on_delete_mixin.py,sha256=XcePzddy8zWwXUYr08eV7xuwfhmZtwhvMJrxlJcQMNA,3113
|
|
1912
1912
|
edc_model_admin/mixins/model_admin_replace_label_text_mixin.py,sha256=6gVwaVVgwPueaOO6rR0MuBe6WK7uWw5YosYOokSohRQ,694
|
|
1913
|
-
edc_model_admin/mixins/templates_model_admin_mixin.py,sha256=
|
|
1913
|
+
edc_model_admin/mixins/templates_model_admin_mixin.py,sha256=tVIhiLCp7IDiBPRn5w43XAiiCrpLBGrCJ3b_ryqPuOo,2619
|
|
1914
1914
|
edc_model_admin/static/edc_model_admin/admin/css/dark_mode.css,sha256=4e8Jqi5u2EZwQVNlj20OORrUVD0kaEx2ywQIxp-Bq5g,706
|
|
1915
1915
|
edc_model_admin/static/edc_model_admin/admin/css/edc_model_admin.css,sha256=t7sO2yR7RlNy-MbWcI98zF9IllzgNBAlov4NqefV2fQ,612
|
|
1916
1916
|
edc_model_admin/static/edc_model_admin/admin/css/themes/edc_deep_purple.css,sha256=8YogS9QYJqTLXf9kCsAZUYJElwZFVExzn3dsuLVGCZI,635
|
|
@@ -3013,7 +3013,7 @@ edc_sites/admin/__init__.py,sha256=WSOdF91qWcdhb4EUqmbKw7yaFMtljf5YWu-K8fdvBAs,2
|
|
|
3013
3013
|
edc_sites/admin/list_filters.py,sha256=P5HE6WYLXOQkgBwGMmsln6eCGu4pBDKCJ9jdcikmKKk,923
|
|
3014
3014
|
edc_sites/admin/site_admin.py,sha256=haNSrz3WiP_cMLv2SHRrKphVo316Z-RKJUORCPtBC5k,351
|
|
3015
3015
|
edc_sites/admin/site_fieldset_tuple.py,sha256=s_TbpCBrM2DBATFmKf6OwnDiDWvcTWc2gfl8EEUNpG8,224
|
|
3016
|
-
edc_sites/admin/site_model_admin_mixin.py,sha256=
|
|
3016
|
+
edc_sites/admin/site_model_admin_mixin.py,sha256=9U2Cqr6iL2JP9l-EBEBfpNESlMJoCeLm2b59jGylBw8,8931
|
|
3017
3017
|
edc_sites/admin_site.py,sha256=AINI5Kxx8_KimVIhpPWz_9PAvMcXGzkLWnEHKAFL-6E,163
|
|
3018
3018
|
edc_sites/apps.py,sha256=MbE5MfmP676ZfwUI9Jsuf6M-KiZSmYvMqJ3zhI8BN-o,2115
|
|
3019
3019
|
edc_sites/auths.py,sha256=oda_eUVL9cyfsVqUK7vpz3X5N4aGqAupVtV_nBY44-E,299
|
|
@@ -3407,7 +3407,7 @@ edc_vitals/models/fields/waist_circumference.py,sha256=fZcHFDdEwWLjIVLktKrFCD9UU
|
|
|
3407
3407
|
edc_vitals/models/fields/weight.py,sha256=zo9_9e3Cpu0UqoRbWS-iDkcDo6fK80b1dDQy4x4MyxE,921
|
|
3408
3408
|
edc_vitals/utils.py,sha256=vXid44KUXxeaSyund_y5MNXc5DFJs052_PwUAjszE2k,1384
|
|
3409
3409
|
edc_vitals/validators.py,sha256=vNiElWMs0rRnHRNuVoPLRf0rW_C_0xcfUyep1Y_Si5s,156
|
|
3410
|
-
clinicedc-2.0.
|
|
3411
|
-
clinicedc-2.0.
|
|
3412
|
-
clinicedc-2.0.
|
|
3413
|
-
clinicedc-2.0.
|
|
3410
|
+
clinicedc-2.0.31.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
|
|
3411
|
+
clinicedc-2.0.31.dist-info/WHEEL,sha256=-neZj6nU9KAMg2CnCY6T3w8J53nx1kFGw_9HfoSzM60,79
|
|
3412
|
+
clinicedc-2.0.31.dist-info/METADATA,sha256=MaP_gtEy-Kg2ff5Wl38Vj4xQN7FzZfyC-0JU2ZQvA94,15786
|
|
3413
|
+
clinicedc-2.0.31.dist-info/RECORD,,
|
edc_auth/utils.py
CHANGED
|
@@ -59,7 +59,7 @@ def remove_default_model_permissions_from_edc_permissions(auth_updater: Any, app
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
def make_view_only_group_permissions(
|
|
62
|
-
prefix: str
|
|
62
|
+
prefix: str, group: Group, model: str|None = None
|
|
63
63
|
):
|
|
64
64
|
"""Remove all but view permissions for model.
|
|
65
65
|
|
|
@@ -30,7 +30,7 @@ class EdcViewMixin(
|
|
|
30
30
|
edc_device_app_config = django_apps.get_app_config(self.edc_device_app)
|
|
31
31
|
except LookupError as e:
|
|
32
32
|
edc_device_app_config = None
|
|
33
|
-
warnings.warn(str(e))
|
|
33
|
+
warnings.warn(str(e), stacklevel=2)
|
|
34
34
|
live_system = getattr(settings, "LIVE_SYSTEM", "TEST")
|
|
35
35
|
kwargs.update(
|
|
36
36
|
{
|
|
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import TYPE_CHECKING
|
|
4
4
|
|
|
5
|
+
from django.contrib import admin
|
|
5
6
|
from django.core.exceptions import ObjectDoesNotExist
|
|
6
7
|
from django.template.loader import render_to_string
|
|
7
8
|
from django.urls import NoReverseMatch, reverse
|
|
@@ -21,6 +22,7 @@ class ModelAdminDashboardMixin:
|
|
|
21
22
|
show_dashboard_in_list_display_pos = None
|
|
22
23
|
view_on_site_label = _("Subject dashboard")
|
|
23
24
|
|
|
25
|
+
@admin.display(description=_("Dashboard"))
|
|
24
26
|
def dashboard(self, obj=None, label=None) -> str:
|
|
25
27
|
url = self.get_subject_dashboard_url(obj=obj)
|
|
26
28
|
if not url:
|
|
@@ -37,19 +39,19 @@ class ModelAdminDashboardMixin:
|
|
|
37
39
|
def get_subject_listboard_url_name(self) -> str:
|
|
38
40
|
return url_names.get(self.subject_listboard_url_name)
|
|
39
41
|
|
|
40
|
-
def get_subject_dashboard_url(self, obj=None) -> str | None:
|
|
42
|
+
def get_subject_dashboard_url(self, obj=None) -> str | None: # noqa: ARG002
|
|
41
43
|
return None
|
|
42
44
|
|
|
43
|
-
def get_subject_dashboard_url_name(self, obj=None) -> str:
|
|
45
|
+
def get_subject_dashboard_url_name(self, obj=None) -> str: # noqa: ARG002
|
|
44
46
|
return url_names.get(self.subject_dashboard_url_name)
|
|
45
47
|
|
|
46
48
|
def get_subject_dashboard_url_kwargs(self, obj) -> dict:
|
|
47
49
|
return dict(subject_identifier=obj.subject_identifier)
|
|
48
50
|
|
|
49
|
-
def get_post_url_on_delete_name(self, *args) -> str:
|
|
51
|
+
def get_post_url_on_delete_name(self, *args) -> str: # noqa: ARG002
|
|
50
52
|
return self.get_subject_dashboard_url_name()
|
|
51
53
|
|
|
52
|
-
def post_url_on_delete_kwargs(self, request, obj) -> dict:
|
|
54
|
+
def post_url_on_delete_kwargs(self, request, obj) -> dict: # noqa: ARG002
|
|
53
55
|
return self.get_subject_dashboard_url_kwargs(obj)
|
|
54
56
|
|
|
55
57
|
def get_registered_subject(self, obj) -> RegisteredSubject:
|
|
@@ -85,5 +87,7 @@ class ModelAdminDashboardMixin:
|
|
|
85
87
|
if callable(super().view_on_site):
|
|
86
88
|
url = super().view_on_site(obj)
|
|
87
89
|
else:
|
|
88
|
-
raise NoReverseMatch(
|
|
90
|
+
raise NoReverseMatch(
|
|
91
|
+
f"{e}. See subject_dashboard_url_name for {self!r}."
|
|
92
|
+
) from e
|
|
89
93
|
return url
|
|
@@ -112,9 +112,9 @@ class ModelAdminNextUrlRedirectMixin(BaseModelAdminRedirectMixin):
|
|
|
112
112
|
msg = f"{e}. Got url_name={url_name}, kwargs={options}."
|
|
113
113
|
try:
|
|
114
114
|
redirect_url = reverse(url_name) # retry without kwargs
|
|
115
|
-
except NoReverseMatch:
|
|
115
|
+
except NoReverseMatch as e:
|
|
116
116
|
# raise with first exception msg
|
|
117
|
-
raise ModelAdminNextUrlRedirectError(msg)
|
|
117
|
+
raise ModelAdminNextUrlRedirectError(msg) from e
|
|
118
118
|
else:
|
|
119
119
|
if "q" in options and "changelist" in url_name:
|
|
120
120
|
redirect_url = f"{redirect_url}?q={options['q']}"
|
|
@@ -163,7 +163,7 @@ class ModelAdminNextUrlRedirectMixin(BaseModelAdminRedirectMixin):
|
|
|
163
163
|
)
|
|
164
164
|
return None
|
|
165
165
|
|
|
166
|
-
def get_next_options(self, request=None, **kwargs):
|
|
166
|
+
def get_next_options(self, request=None, **kwargs): # noqa: ARG002
|
|
167
167
|
"""Returns the key/value pairs from the "next" querystring
|
|
168
168
|
as a dictionary.
|
|
169
169
|
"""
|
|
@@ -24,10 +24,10 @@ class ModelAdminRedirectOnDeleteMixin:
|
|
|
24
24
|
self.post_url_on_delete = None
|
|
25
25
|
super().__init__(*args)
|
|
26
26
|
|
|
27
|
-
def get_post_url_on_delete_name(self, request) -> str:
|
|
27
|
+
def get_post_url_on_delete_name(self, request) -> str: # noqa: ARG002
|
|
28
28
|
return url_names.get(self.post_url_on_delete_name)
|
|
29
29
|
|
|
30
|
-
def get_post_full_url_on_delete(self, request) -> str | None:
|
|
30
|
+
def get_post_full_url_on_delete(self, request) -> str | None: # noqa: ARG002
|
|
31
31
|
return self.post_full_url_on_delete
|
|
32
32
|
|
|
33
33
|
def get_post_url_on_delete(self, request, obj) -> str | None:
|
|
@@ -50,14 +50,14 @@ class ModelAdminRedirectOnDeleteMixin:
|
|
|
50
50
|
post_url_on_delete = f"{post_url_on_delete}?{querystring}"
|
|
51
51
|
return post_url_on_delete
|
|
52
52
|
|
|
53
|
-
def post_url_on_delete_kwargs(self, request, obj) -> dict:
|
|
53
|
+
def post_url_on_delete_kwargs(self, request, obj) -> dict: # noqa: ARG002
|
|
54
54
|
"""Returns kwargs needed to reverse the url.
|
|
55
55
|
|
|
56
56
|
Override.
|
|
57
57
|
"""
|
|
58
58
|
return {}
|
|
59
59
|
|
|
60
|
-
def post_url_on_delete_querystring_kwargs(self, request, obj) -> dict:
|
|
60
|
+
def post_url_on_delete_querystring_kwargs(self, request, obj) -> dict: # noqa: ARG002
|
|
61
61
|
"""Returns kwargs for a querystring for the reversed url.
|
|
62
62
|
|
|
63
63
|
Override.
|
|
@@ -75,10 +75,8 @@ class ModelAdminRedirectOnDeleteMixin:
|
|
|
75
75
|
"""Overridden to redirect to `post_url_on_delete`, if not None."""
|
|
76
76
|
if self.post_url_on_delete:
|
|
77
77
|
opts = self.model._meta
|
|
78
|
-
msg = 'The
|
|
79
|
-
|
|
80
|
-
"obj": force_str(obj_display),
|
|
81
|
-
}
|
|
78
|
+
msg = (f'The {force_str(opts.verbose_name)} "{force_str(obj_display)}" '
|
|
79
|
+
'was deleted successfully.')
|
|
82
80
|
messages.add_message(request, messages.SUCCESS, msg)
|
|
83
81
|
return HttpResponseRedirect(self.post_url_on_delete)
|
|
84
82
|
return super().response_delete(request, obj_display, obj_id)
|
|
@@ -59,7 +59,7 @@ class TemplatesModelAdminMixin:
|
|
|
59
59
|
)
|
|
60
60
|
|
|
61
61
|
def changelist_view(self, request, extra_context=None):
|
|
62
|
-
extra_context =
|
|
62
|
+
extra_context = extra_context if extra_context else {}
|
|
63
63
|
extra_context.update(
|
|
64
64
|
{
|
|
65
65
|
"show_object_tools": self.show_object_tools,
|
|
@@ -95,12 +95,12 @@ class SiteModelAdminMixin:
|
|
|
95
95
|
or self.has_viewallsites_permission(request)
|
|
96
96
|
) and "site" not in list_display:
|
|
97
97
|
list_display = tuple(list_display)
|
|
98
|
-
list_display = list_display[:pos], self.site_code, list_display[pos:]
|
|
98
|
+
list_display = *list_display[:pos], self.site_code, *list_display[pos:]
|
|
99
99
|
elif "site" in list_display:
|
|
100
100
|
list_display = tuple(
|
|
101
101
|
[x for x in list_display if x not in ["site", self.site_code]]
|
|
102
102
|
)
|
|
103
|
-
list_display = list_display[:pos], self.site_code, list_display[pos:]
|
|
103
|
+
list_display = *list_display[:pos], self.site_code, *list_display[pos:]
|
|
104
104
|
return list_display
|
|
105
105
|
|
|
106
106
|
def get_queryset(self, request) -> QuerySet:
|
|
File without changes
|
|
File without changes
|