vergabe-teilnahme/vergabe_teilnahme/apps/accounts/models.py
tegwick 8be281025b
Some checks failed
CI Smoke / host-smoke (push) Waiting to run
CI Smoke / container-smoke (push) Waiting to run
Application acceptance / application-tests (push) Has been cancelled
Build and Publish Container Image / build-and-push (push) Successful in 40s
Add company welcome and verified NetKingdom sign-in
Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a092fe-13b1-7f12-ac74-7d258af4d79c
2026-09-12 02:43:31 +02:00

35 lines
1.3 KiB
Python

from django.contrib.auth.models import AbstractUser
from django.db import models
class Mitarbeiter(AbstractUser):
ROLLE_CHOICES = [
('bid_manager', 'Bid Manager'),
('fachexperte', 'Fachverantwortlicher'),
('vertrieb', 'Vertrieb / Account Management'),
('pricing', 'Pricing / Controlling'),
('recht', 'Recht / Compliance'),
('geschaeftsfuehrung', 'Geschäftsführung'),
('projektleitung', 'Projektleitung Umsetzung'),
('admin', 'Administrator'),
]
rolle = models.CharField(max_length=30, choices=ROLLE_CHOICES, blank=True)
mobilnummer = models.CharField(max_length=50, blank=True)
organisationseinheit = models.CharField(max_length=200, blank=True)
def __str__(self):
return self.get_full_name() or self.username
class Meta:
verbose_name = 'Mitarbeiter'
verbose_name_plural = 'Mitarbeiter'
class OIDCIdentity(models.Model):
issuer = models.CharField(max_length=512)
subject = models.CharField(max_length=512)
user = models.OneToOneField(Mitarbeiter, on_delete=models.PROTECT)
class Meta:
constraints = [models.UniqueConstraint(fields=['issuer', 'subject'],
name='unique_oidc_identity')]