From 0bde216d6ffadb2e774d0467c39a50580662effd Mon Sep 17 00:00:00 2001 From: Erica Nwoga <66533300+chimsara@users.noreply.github.com> Date: Tue, 1 Aug 2023 11:39:25 -0400 Subject: [PATCH] feat: added ltipiitool model (#32790) * feat: added ltipiitool model * feat: added ltipiitool model * feat: created ltipiitool model * chore: squashed ltipiitool mirgation files for agreements app. * chore: fixed migration files --- .../agreements/migrations/0002_ltipiitool.py | 23 +++++++++++++++++++ openedx/core/djangoapps/agreements/models.py | 12 ++++++++++ 2 files changed, 35 insertions(+) create mode 100644 openedx/core/djangoapps/agreements/migrations/0002_ltipiitool.py diff --git a/openedx/core/djangoapps/agreements/migrations/0002_ltipiitool.py b/openedx/core/djangoapps/agreements/migrations/0002_ltipiitool.py new file mode 100644 index 00000000000..fde896bc8d7 --- /dev/null +++ b/openedx/core/djangoapps/agreements/migrations/0002_ltipiitool.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.20 on 2023-08-01 14:06 + +from django.db import migrations, models +import opaque_keys.edx.django.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('agreements', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='LTIPIITool', + 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, unique=True)), + ('lti_tools', models.JSONField()), + ('lti_tools_hash', models.IntegerField()), + ], + ), + ] diff --git a/openedx/core/djangoapps/agreements/models.py b/openedx/core/djangoapps/agreements/models.py index cf39a84c315..01f1fb8258d 100644 --- a/openedx/core/djangoapps/agreements/models.py +++ b/openedx/core/djangoapps/agreements/models.py @@ -22,3 +22,15 @@ class IntegritySignature(TimeStampedModel): class Meta: app_label = 'agreements' unique_together = ('user', 'course_key') + + +class LTIPIITool(models.Model): + """ + This model stores the relationship between a course and the LTI tools in the course that share PII. + """ + course_key = CourseKeyField(max_length=255, unique=True, db_index=True) + lti_tools = models.JSONField() + lti_tools_hash = models.IntegerField() + + class Meta: + app_label = 'agreements'