feat: created ltipiisignature model (#32853)

* feat: created ltipiisignature model
This commit is contained in:
Erica Nwoga
2023-08-03 10:17:52 -04:00
committed by GitHub
parent 1b9d9bfc45
commit 87a6664013
3 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# Generated by Django 3.2.20 on 2023-08-02 13:59
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import opaque_keys.edx.django.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('agreements', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='LTIPIISignature',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('course_key', opaque_keys.edx.django.models.CourseKeyField(db_index=True, max_length=255)),
('lti_tools', models.JSONField()),
('lti_tools_hash', models.IntegerField()),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]

View File

@@ -0,0 +1,14 @@
# Generated by Django 3.2.20 on 2023-08-03 13:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('agreements', '0002_ltipiisignature'),
('agreements', '0002_ltipiitool'),
]
operations = [
]

View File

@@ -34,3 +34,21 @@ class LTIPIITool(models.Model):
class Meta:
app_label = 'agreements'
class LTIPIISignature(models.Model):
"""
This model stores a user's acknowledgement to share PII via LTI tools in a particular course.
"""
user = models.ForeignKey(User, db_index=True, on_delete=models.CASCADE)
course_key = CourseKeyField(max_length=255, db_index=True)
lti_tools = models.JSONField()
# lti_tools_hash represents the hash of the list of LTI tools receiving
# PII acknowledged by the user. The hash is used to compare user
# acknowledgments - which reduces response time and decreases any impact
# on unit rendering time.
lti_tools_hash = models.IntegerField()
class Meta:
app_label = 'agreements'