@ -8,13 +8,30 @@ from django.template.loader import get_template
from django.template import Context
from django.template import Context
from .forms import ProjectForm , VolunteerForm , LibraryForm , IFGForm
from .forms import ProjectForm , VolunteerForm , LibraryForm , IFGForm
from .models import Project , TYPE_CHOICES
from .models import Project , TYPE_CHOICES , Library
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 ) :
return HttpResponse ( f " AUTHORIZE! choice: {choice}, pk: {pk} " )
if choice in ( ' BIB ' , ' ELIT ' , ' SOFT ' ) :
set_granted_in_lib ( pk , True )
return HttpResponse ( f " AUTHORIZED! choice: {choice}, pk: {pk} " )
else :
return HttpResponse ( ' ERROR! UNKNWON CHOICE TYPE! ' )
def deny ( request , choice , pk ) :
def deny ( request , choice , pk ) :
return HttpResponse ( f " DENY! choice: {choice}, pk: {pk} " )
if choice in ( ' BIB ' , ' ELIT ' , ' SOFT ' ) :
set_granted_in_lib ( pk , False )
return HttpResponse ( f " DENIED! choice: {choice}, pk: {pk} " )
else :
return HttpResponse ( ' ERROR! UNKNWON CHOICE TYPE! ' )
def project ( request ) :
def project ( request ) :
# return HttpResponse("Hello, world. You're at the input form")
# return HttpResponse("Hello, world. You're at the input form")