Browse Source

bugfix in auth_deny

master
Benni Baermann 3 years ago
parent
commit
bd8aced23f
2 changed files with 21 additions and 3 deletions
  1. +18
    -0
      input/migrations/0057_auto_20210104_0937.py
  2. +3
    -3
      input/views.py

+ 18
- 0
input/migrations/0057_auto_20210104_0937.py 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'),
),
]

+ 3
- 3
input/views.py View File

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

Loading…
Cancel
Save