Set name, realm and seed for superusers also
This commit is contained in:
parent
273a1acf01
commit
9703eb6538
1 changed files with 3 additions and 0 deletions
|
@ -4,6 +4,7 @@ from rest_framework import exceptions
|
||||||
from rest_framework import authentication
|
from rest_framework import authentication
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
import pyotp
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -25,6 +26,8 @@ class OTPSeed(AbstractUser):
|
||||||
self.username = "{}@{}".format(self.name, self.realm)
|
self.username = "{}@{}".format(self.name, self.realm)
|
||||||
else:
|
else:
|
||||||
self.name = self.username
|
self.name = self.username
|
||||||
|
self.realm = "ungleich-admin"
|
||||||
|
self.seed = pyotp.random_base32()
|
||||||
|
|
||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue