Skip to content

Commit

Permalink
backend stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
im-still-thinking committed Feb 4, 2023
1 parent b1bba80 commit 4916922
Show file tree
Hide file tree
Showing 36 changed files with 28 additions and 20 deletions.
46 changes: 27 additions & 19 deletions studentBackend/api/routes/students/routes.py
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")))
2 changes: 1 addition & 1 deletion teacherBackend/api/routes/teacher/routes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Blueprint, request, url_for, session, redirect
from flask import Blueprint, request, session
from flask_cors import cross_origin

from datetime import datetime
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

1 comment on commit 4916922

@vercel
Copy link

@vercel vercel bot commented on 4916922 Feb 4, 2023

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:

Resource is limited - try again in 3 hours (more than 100, code: "api-deployments-free-per-day").

Please sign in to comment.