Skip to content

Commit 02cb277

Browse files
committed
Merge branch 'release/0.3.58' into main
2 parents 46b2ea2 + 979b969 commit 02cb277

File tree

4 files changed

+94
-14
lines changed

4 files changed

+94
-14
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Generated by Django 4.2.7 on 2023-12-01 14:47
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("edc_consent", "0002_alter_edcpermissions_device_created_and_more"),
9+
]
10+
11+
operations = [
12+
migrations.AddField(
13+
model_name="edcpermissions",
14+
name="locale_created",
15+
field=models.CharField(
16+
blank=True,
17+
help_text="Auto-updated by Modeladmin",
18+
max_length=10,
19+
null=True,
20+
verbose_name="Locale created",
21+
),
22+
),
23+
migrations.AddField(
24+
model_name="edcpermissions",
25+
name="locale_modified",
26+
field=models.CharField(
27+
blank=True,
28+
help_text="Auto-updated by Modeladmin",
29+
max_length=10,
30+
null=True,
31+
verbose_name="Locale modified",
32+
),
33+
),
34+
]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Generated by Django 4.2.7 on 2023-12-04 22:19
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("edc_consent", "0003_edcpermissions_locale_created_and_more"),
9+
]
10+
11+
operations = [
12+
migrations.AlterModelOptions(
13+
name="edcpermissions",
14+
options={
15+
"default_manager_name": "objects",
16+
"default_permissions": (
17+
"add",
18+
"change",
19+
"delete",
20+
"view",
21+
"export",
22+
"import",
23+
),
24+
"verbose_name": "Edc Permissions",
25+
"verbose_name_plural": "Edc Permissions",
26+
},
27+
),
28+
migrations.AddIndex(
29+
model_name="edcpermissions",
30+
index=models.Index(
31+
fields=["modified", "created"], name="edc_consent_modifie_851b6a_idx"
32+
),
33+
),
34+
migrations.AddIndex(
35+
model_name="edcpermissions",
36+
index=models.Index(
37+
fields=["user_modified", "user_created"],
38+
name="edc_consent_user_mo_27c64b_idx",
39+
),
40+
),
41+
]

edc_consent/model_mixins/consent_model_mixin.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from uuid import uuid4
22

33
from django.db import models
4-
from django.db.models import options
4+
from django.db.models import UniqueConstraint, options
55
from django_crypto_fields.fields import EncryptedTextField
66
from edc_constants.constants import OPEN
77
from edc_data_manager.get_data_queries import get_data_queries
@@ -148,21 +148,26 @@ class Meta:
148148
verbose_name = "Subject Consent"
149149
verbose_name_plural = "Subject Consents"
150150
consent_group = DEFAULT_CONSENT_GROUP
151-
get_latest_by = "consent_datetime"
152-
unique_together = (
153-
("first_name", "dob", "initials", "version"),
154-
("subject_identifier", "version"),
155-
)
156-
ordering = ("created",)
157-
158-
indexes = [
159-
models.Index(
151+
constraints = [
152+
UniqueConstraint(
153+
fields=["first_name", "dob", "initials", "version"],
154+
name="%(app_label)s_%(class)s_first_uniq",
155+
),
156+
UniqueConstraint(
160157
fields=[
161158
"subject_identifier",
162159
"first_name",
163160
"dob",
164161
"initials",
165162
"version",
166-
]
167-
)
163+
],
164+
name="%(app_label)s_%(class)s_subject_uniq",
165+
),
166+
UniqueConstraint(
167+
fields=[
168+
"version",
169+
"subject_identifier",
170+
],
171+
name="%(app_label)s_%(class)s_version_uniq",
172+
),
168173
]

edc_consent/models/edc_permissions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
class EdcPermissions(EdcPermissionsModelMixin, BaseUuidModel):
66
# see edc_auth for permissions attached to this model
77

8-
class Meta(EdcPermissionsModelMixin.Meta):
9-
pass
8+
class Meta(EdcPermissionsModelMixin.Meta, BaseUuidModel.Meta):
9+
indexes = BaseUuidModel.Meta.indexes

0 commit comments

Comments
 (0)