bugfix in auth_deny

This commit is contained in:
Benni Bärmann 2021-01-04 10:44:03 +01:00
parent f2ec1a4994
commit bd8aced23f
2 changed files with 21 additions and 3 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 3.1.1 on 2021-01-04 09:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('input', '0056_auto_20201217_1215'),
]
operations = [
migrations.AlterField(
model_name='project',
name='account',
field=models.CharField(choices=[('21111', '21111 Förderung (reaktiv)'), ('21112', '21112 WikiCon'), ('21115', '21115 Lokale Räume, Berlin'), ('21116', '21116 Lokale Räume, Hamburg'), ('21117', '21117 Lokale Räume, Hannover'), ('21118', '21118 Lokale Räume, Köln'), ('21119', '21119 Lokale Räume, München'), ('21120', '21120 Lokale Räume, Fürth'), ('21125', '21125 Lokale Räume, allgemein'), ('21130', '21130 GLAM-Förderung'), ('21131', '21131 Initiative Förderung'), ('21140', '21140 Wikipedia-Kampagne'), ('21141', '21141 Wikipedia-Onboarding'), ('21150', '21150 Fürsorge und Online-Kommunikationskultur')], max_length=5, null=True, verbose_name='Kostenstelle'),
),
]

View File

@ -22,9 +22,9 @@ from .settings import IF_EMAIL
def auth_deny(choice,pk,auth):
if choice in ('BIB', 'ELIT', 'SOFT'):
Library.set_granted(pk,auth)
if choice == 'LIT':
elif choice == 'LIT':
Literature.set_granted(pk,auth)
if choice == 'IFG':
elif choice == 'IFG':
IFG.set_granted(pk,auth)
else:
return HttpResponse(f'ERROR! UNKNWON CHOICE TYPE! {choice}')
@ -34,7 +34,7 @@ def auth_deny(choice,pk,auth):
def export(request):
'''export the project database to a csv'''
return HttpResponse('WE WANT CSV!')
@login_required
def authorize(request, choice, pk):
'''If IF grant a support they click a link in a mail which leads here.