-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1bba80
commit 4916922
Showing
36 changed files
with
28 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,34 @@ | ||
from flask import Blueprint, url_for, session, redirect | ||
from flask import Blueprint, request, session | ||
from flask_cors import cross_origin | ||
|
||
from studentBackend.api import Notice | ||
from studentBackend.api.model.noticeboardmodel import NoticeBoardModel, NoticeModel | ||
from studentBackend.api.schema.noticeboard import NoticeBoardSchema | ||
from datetime import datetime | ||
from pytz import timezone | ||
|
||
from api.model.noticeboardmodel import NoticeBoardModel, NoticeModel | ||
from api.schema.noticeboard import NoticeBoardSchema | ||
|
||
from api.model.assignmentsmodel import AssignmentList, Assignment | ||
from api.schema.assignments import AssignmentListSchema | ||
|
||
from api.services.database import Teachers, Notice, Assignments, Students | ||
|
||
student_bp = Blueprint('student', __name__) | ||
|
||
|
||
@student_bp.route("/noticeboard/") | ||
def get_notices(): | ||
if session: | ||
noticeBoard = NoticeBoardModel() | ||
for notices in Notice.objects: | ||
data = notices.data | ||
date = notices.date | ||
time = notices.time | ||
isFile = notices.isFile | ||
fileURL = notices.fileURL | ||
|
||
notice = NoticeModel(data, date, time, isFile, fileURL) | ||
noticeBoard.notices.append(notice) | ||
|
||
return NoticeBoardSchema().dumps(noticeBoard), 200 | ||
else: | ||
return redirect(url_for("auth.login", redirect_uri=url_for(".get_notices"))) | ||
# if session: | ||
noticeBoard = NoticeBoardModel() | ||
for notices in Notice.objects: | ||
data = notices.data | ||
date = notices.date | ||
time = notices.time | ||
isFile = notices.isFile | ||
fileURL = notices.fileURL | ||
|
||
notice = NoticeModel(data, date, time, isFile, fileURL) | ||
noticeBoard.notices.append(notice) | ||
|
||
return NoticeBoardSchema().dumps(noticeBoard), 200 | ||
# else: | ||
# return redirect(url_for("auth.login", redirect_uri=url_for(".get_notices"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
teacherBackend/venv/lib/python3.10/site-packages/__pycache__/_virtualenv.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...nd/venv/lib/python3.10/site-packages/_distutils_hack/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...kend/venv/lib/python3.10/site-packages/pkg_resources/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...v/lib/python3.10/site-packages/pkg_resources/_vendor/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...nv/lib/python3.10/site-packages/pkg_resources/_vendor/__pycache__/appdirs.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ython3.10/site-packages/pkg_resources/_vendor/jaraco/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...python3.10/site-packages/pkg_resources/_vendor/jaraco/__pycache__/context.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...thon3.10/site-packages/pkg_resources/_vendor/jaraco/__pycache__/functools.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...3.10/site-packages/pkg_resources/_vendor/jaraco/text/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...0/site-packages/pkg_resources/_vendor/more_itertools/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...n3.10/site-packages/pkg_resources/_vendor/more_itertools/__pycache__/more.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...10/site-packages/pkg_resources/_vendor/more_itertools/__pycache__/recipes.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...n3.10/site-packages/pkg_resources/_vendor/packaging/__pycache__/__about__.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...on3.10/site-packages/pkg_resources/_vendor/packaging/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...3.10/site-packages/pkg_resources/_vendor/packaging/__pycache__/_manylinux.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...3.10/site-packages/pkg_resources/_vendor/packaging/__pycache__/_musllinux.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
....10/site-packages/pkg_resources/_vendor/packaging/__pycache__/_structures.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...hon3.10/site-packages/pkg_resources/_vendor/packaging/__pycache__/markers.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...10/site-packages/pkg_resources/_vendor/packaging/__pycache__/requirements.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...3.10/site-packages/pkg_resources/_vendor/packaging/__pycache__/specifiers.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...python3.10/site-packages/pkg_resources/_vendor/packaging/__pycache__/tags.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...ython3.10/site-packages/pkg_resources/_vendor/packaging/__pycache__/utils.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...hon3.10/site-packages/pkg_resources/_vendor/packaging/__pycache__/version.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...on3.10/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...hon3.10/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/actions.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...thon3.10/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/common.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...python3.10/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/core.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...3.10/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/exceptions.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...hon3.10/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/helpers.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...hon3.10/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/results.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...hon3.10/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/testing.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...hon3.10/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/unicode.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...python3.10/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/util.cpython-310.pyc
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
...nv/lib/python3.10/site-packages/pkg_resources/extern/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
4916922
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deployment failed with the following error: