Files
edx-platform/openedx/core/djangoapps/agreements/models.py
Bianca Severino e41e6e04ee feat: initialize agreements app
Adds an app to openedx for the Agreements feature.
Includes an IntegritySignature model with a basic
API, as well as a waffle flag to support rollout.
2021-05-10 17:55:36 -04:00

25 lines
631 B
Python

"""
Agreements models
"""
from django.contrib.auth import get_user_model
from django.db import models
from model_utils.models import TimeStampedModel
from opaque_keys.edx.django.models import CourseKeyField
User = get_user_model()
class IntegritySignature(TimeStampedModel):
"""
This model represents an integrity signature for a user + course combination.
.. no_pii:
"""
user = models.ForeignKey(User, db_index=True, on_delete=models.CASCADE)
course_key = CourseKeyField(max_length=255, db_index=True)
class Meta:
app_label = 'agreements'
unique_together = ('user', 'course_key')