from django.contrib.auth import get_user_model
from django.db import models


from app.utils.models import BaseModel


from simple_history.models import HistoricalRecords


User = get_user_model()


class UserSettings(BaseModel):
    user = models.OneToOneField(User, on_delete=models.PROTECT, related_name="setting")

    # The private and public key are wrapped with the AES key from the front-end
    public_key = models.TextField(max_length=2048, null=True)
    private_key = models.TextField(max_length=2048, null=True)

    history = HistoricalRecords()
