summaryrefslogtreecommitdiffstats
path: root/mellon/models.py
blob: 9368a1ddb11148a8cc800a86a152d322b0f7886f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings


class UserSAMLIdentifier(models.Model):
    user = models.ForeignKey(
        verbose_name=_('user'),
        to=settings.AUTH_USER_MODEL,
        related_name='saml_identifiers')
    issuer = models.TextField(
        verbose_name=_('Issuer'))
    name_id = models.TextField(
        verbose_name=_('SAML identifier'))
    created = models.DateTimeField(
        verbose_name=_('created'),
        auto_now_add=True)

    class Meta:
        verbose_name = _('user SAML identifier')
        verbose_name_plural = _('users SAML identifiers')
        unique_together = (('issuer', 'name_id'),)