Added missing OSGeo4W import

This commit is contained in:
Keannu Bernasol 2023-07-09 19:07:33 +08:00
parent 98177f7235
commit 1f960aeaac
2 changed files with 12 additions and 2 deletions

View file

@ -51,6 +51,16 @@ else:
EMAIL_PORT = str(os.getenv('PROD_EMAIL_PORT'))
EMAIL_USE_TLS = str(os.getenv('PROD_EMAIL_TLS'))
# Will need to install OSGeo4W for this!
if os.name == 'nt':
OSGEO4W = r"C:\OSGeo4W"
assert os.path.isdir(OSGEO4W), "Directory does not exist: " + OSGEO4W
os.environ['OSGEO4W_ROOT'] = OSGEO4W
os.environ['GDAL_DATA'] = "C:\Program Files\GDAL\gdal-data"
os.environ['PROJ_LIB'] = OSGEO4W + r"\share\proj"
GDAL_LIBRARY_PATH = r'C:\OSGeo4W64\bin\gdal204'
os.environ['PATH'] = OSGEO4W + r"\bin;" + os.environ['PATH']
GEOS_LIBRARY_PATH = str(os.environ.get('VIRTUAL_ENV') +
r"\Lib\site-packages\osgeo\geos_c.dll")
GDAL_LIBRARY_PATH = str(os.environ.get('VIRTUAL_ENV') +

View file

@ -15,8 +15,8 @@ class StudentStatusAPIView(generics.RetrieveUpdateAPIView):
class ActiveStudentStatusListAPIView(generics.ListAPIView):
serializer_class = StudentStatusSerializer
permission_classes = [IsAuthenticated]
# permission_classes = [IsAuthenticated]
def get_queryset(self):
user = self.request.user
return StudentStatus.objects.filter(active=True).exclude(user=user)
return StudentStatus.objects.filter(active=True)