|
@ -13,15 +13,9 @@ from .models import Project, TYPE_CHOICES, Library |
|
|
from .settings import URLPREFIX, IF_EMAIL |
|
|
from .settings import URLPREFIX, IF_EMAIL |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_granted_in_lib(key,b): |
|
|
|
|
|
lib = Library.objects.get(pk=key) |
|
|
|
|
|
lib.granted = b |
|
|
|
|
|
lib.save() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def authorize(request, choice, pk): |
|
|
def authorize(request, choice, pk): |
|
|
if choice in ('BIB', 'ELIT', 'SOFT'): |
|
|
if choice in ('BIB', 'ELIT', 'SOFT'): |
|
|
set_granted_in_lib(pk,True) |
|
|
|
|
|
|
|
|
Library.set_granted(pk,True) |
|
|
return HttpResponse(f"AUTHORIZED! choice: {choice}, pk: {pk}") |
|
|
return HttpResponse(f"AUTHORIZED! choice: {choice}, pk: {pk}") |
|
|
else: |
|
|
else: |
|
|
return HttpResponse('ERROR! UNKNWON CHOICE TYPE!') |
|
|
return HttpResponse('ERROR! UNKNWON CHOICE TYPE!') |
|
|