24 lines
647 B
Python
24 lines
647 B
Python
from django.db import models
|
|
|
|
from vbv_lernwelt.core.models import User
|
|
|
|
|
|
class SsoSyncError(models.Model):
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
updated_at = models.DateTimeField(auto_now=True)
|
|
|
|
user = models.ForeignKey(User, on_delete=models.CASCADE)
|
|
|
|
class Action(models.TextChoices):
|
|
ADD = "ADD", "Add"
|
|
REMOVE = "REMOVE", "Remove"
|
|
CREATE = "CREATE", "Create"
|
|
|
|
action = models.CharField(
|
|
choices=Action.choices, max_length=255, default=Action.ADD
|
|
)
|
|
data = models.JSONField(default=dict, blank=True)
|
|
|
|
def __str__(self):
|
|
return f"{self.user} ({self.action})"
|