Skip to content

Commit

Permalink
Merge branch 'release/0.3.58' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Dec 5, 2023
2 parents 46b2ea2 + 979b969 commit 02cb277
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 4.2.7 on 2023-12-01 14:47

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("edc_consent", "0002_alter_edcpermissions_device_created_and_more"),
]

operations = [
migrations.AddField(
model_name="edcpermissions",
name="locale_created",
field=models.CharField(
blank=True,
help_text="Auto-updated by Modeladmin",
max_length=10,
null=True,
verbose_name="Locale created",
),
),
migrations.AddField(
model_name="edcpermissions",
name="locale_modified",
field=models.CharField(
blank=True,
help_text="Auto-updated by Modeladmin",
max_length=10,
null=True,
verbose_name="Locale modified",
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Generated by Django 4.2.7 on 2023-12-04 22:19

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("edc_consent", "0003_edcpermissions_locale_created_and_more"),
]

operations = [
migrations.AlterModelOptions(
name="edcpermissions",
options={
"default_manager_name": "objects",
"default_permissions": (
"add",
"change",
"delete",
"view",
"export",
"import",
),
"verbose_name": "Edc Permissions",
"verbose_name_plural": "Edc Permissions",
},
),
migrations.AddIndex(
model_name="edcpermissions",
index=models.Index(
fields=["modified", "created"], name="edc_consent_modifie_851b6a_idx"
),
),
migrations.AddIndex(
model_name="edcpermissions",
index=models.Index(
fields=["user_modified", "user_created"],
name="edc_consent_user_mo_27c64b_idx",
),
),
]
29 changes: 17 additions & 12 deletions edc_consent/model_mixins/consent_model_mixin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from uuid import uuid4

from django.db import models
from django.db.models import options
from django.db.models import UniqueConstraint, options
from django_crypto_fields.fields import EncryptedTextField
from edc_constants.constants import OPEN
from edc_data_manager.get_data_queries import get_data_queries
Expand Down Expand Up @@ -148,21 +148,26 @@ class Meta:
verbose_name = "Subject Consent"
verbose_name_plural = "Subject Consents"
consent_group = DEFAULT_CONSENT_GROUP
get_latest_by = "consent_datetime"
unique_together = (
("first_name", "dob", "initials", "version"),
("subject_identifier", "version"),
)
ordering = ("created",)

indexes = [
models.Index(
constraints = [
UniqueConstraint(
fields=["first_name", "dob", "initials", "version"],
name="%(app_label)s_%(class)s_first_uniq",
),
UniqueConstraint(
fields=[
"subject_identifier",
"first_name",
"dob",
"initials",
"version",
]
)
],
name="%(app_label)s_%(class)s_subject_uniq",
),
UniqueConstraint(
fields=[
"version",
"subject_identifier",
],
name="%(app_label)s_%(class)s_version_uniq",
),
]
4 changes: 2 additions & 2 deletions edc_consent/models/edc_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
class EdcPermissions(EdcPermissionsModelMixin, BaseUuidModel):
# see edc_auth for permissions attached to this model

class Meta(EdcPermissionsModelMixin.Meta):
pass
class Meta(EdcPermissionsModelMixin.Meta, BaseUuidModel.Meta):
indexes = BaseUuidModel.Meta.indexes

0 comments on commit 02cb277

Please sign in to comment.