Skip to content

Commit

Permalink
feat: created ltipiisignature model (openedx#32853)
Browse files Browse the repository at this point in the history
* feat: created ltipiisignature model
  • Loading branch information
ericanwoga committed Aug 3, 2023
1 parent 1b9d9bf commit 87a6664
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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)),
],
),
]
Original file line number Diff line number Diff line change
@@ -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 = [
]
18 changes: 18 additions & 0 deletions openedx/core/djangoapps/agreements/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 87a6664

Please sign in to comment.