Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django brugere og IDM #219

Open
neic opened this issue Jul 30, 2018 · 1 comment
Open

Django brugere og IDM #219

neic opened this issue Jul 30, 2018 · 1 comment

Comments

@neic
Copy link
Member

neic commented Jul 30, 2018

Django auth brugere skalere ikke. Det burde skrives sammen med IDM og man skal kunne logge ind med alle ens aliaser.

Se også #177 om KBESTs adgang.

@Mortal
Copy link
Contributor

Mortal commented Sep 23, 2018

Jeg har netop oprettet brugere til BEST via følgende script (pastet ind i manage.py shell).

from tkweb.apps.idm.models import *
from django.contrib.auth.models import User, Group
titles = 'CERM FORM INKA KASS PR SEKR VC'.split()
usernames = [...]
User.objects.filter(username__in=usernames).delete()
passwords = [...]
fudo = User.objects.get(username='fudo')
groups = list(fudo.groups.exclude(name='NF'))
for root, username, password in zip(titles, usernames, passwords):
	t = Title.objects.get(period=2018, root=root)
	first, last = t.profile.name.split(' ', 1)
	user = User(username=username, first_name=first, last_name=last, is_staff=True, email=t.profile.email)
	user.set_password(password)
	user.save()
	user.groups.set(groups)
	user.groups.add(Group.objects.get(name=root))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants