From 86a783857795d7d0f5c2d7ad319cc9239d565130 Mon Sep 17 00:00:00 2001 From: Jarne Andries Date: Sun, 22 May 2022 20:54:51 +0200 Subject: [PATCH 1/3] bugfix filters --- frontend_nextjs/Components/students/StudentsFilters.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend_nextjs/Components/students/StudentsFilters.js b/frontend_nextjs/Components/students/StudentsFilters.js index 3a4da2fe..a1d26b32 100644 --- a/frontend_nextjs/Components/students/StudentsFilters.js +++ b/frontend_nextjs/Components/students/StudentsFilters.js @@ -215,14 +215,14 @@ export default function StudentsFilters() {

Own Suggestion

- addFilter("own_suggestion", own_suggestion, "no-suggestion", ev.target.checked)} /> - addFilter("own_suggestion", own_suggestion, "yes", ev.target.checked)} /> - addFilter("own_suggestion", own_suggestion, "maybe", ev.target.checked)} /> - addFilter("own_suggestion", own_suggestion, "no", ev.target.checked)} /> From e9cb55e1d3ca7f1d4ab634a3bba446e9e60ca04f Mon Sep 17 00:00:00 2001 From: Jarne Andries Date: Sun, 22 May 2022 22:18:43 +0200 Subject: [PATCH 2/3] add first edition --- backend/app/routers/auth.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backend/app/routers/auth.py b/backend/app/routers/auth.py index 42fd69aa..27fcf9ef 100644 --- a/backend/app/routers/auth.py +++ b/backend/app/routers/auth.py @@ -8,6 +8,7 @@ from app.crud import count_where, read_where, update from app.database import db, get_session from app.exceptions.user_exceptions import InvalidEmailOrPasswordException +from app.models.edition import Edition from app.models.passwordreset import EmailInput from app.models.tokens import TokenExtended from app.models.user import User, UserLogin, UserRole @@ -22,6 +23,10 @@ from fastapi_jwt_auth import AuthJWT from pydantic import BaseModel from sqlalchemy.ext.asyncio import AsyncSession +from app.routers.editions import create_edition +import datetime +from app.models.question import Question +from app.models.question_tag import QuestionTag oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") load_dotenv() @@ -117,6 +122,15 @@ async def login(user: UserLogin, Authorize: AuthJWT = Depends(), session: AsyncS approved=True, disabled=False) u = await update(new_user, session) + year = datetime.date.today().year + # make the first edition + new_edition = await update(Edition(year=year, name="my first edition"), session=session) + for mand_tag in ["first name", "last name", "email", "alumni", "student-coach", "skills"]: + new_q = Question(edition=new_edition.year, question="please configure the question fot the tag '" + mand_tag + "'.") + await update(new_q, session=session) + new_qt = QuestionTag(edition=new_edition.year, tag=mand_tag, question=new_q, mandatory=True, show_in_list=False) + await update(new_qt, session=session) + else: u = await read_where(User, User.email == user.email, User.disabled == False, User.active == True, From 5cd57cef87f20ee4c636e32474d17dd4487ef2a7 Mon Sep 17 00:00:00 2001 From: Jarne-Andries <99811344+Jarne-Andries@users.noreply.github.com> Date: Sun, 22 May 2022 22:24:08 +0200 Subject: [PATCH 3/3] Update auth.py --- backend/app/routers/auth.py | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/app/routers/auth.py b/backend/app/routers/auth.py index 27fcf9ef..afa8e8af 100644 --- a/backend/app/routers/auth.py +++ b/backend/app/routers/auth.py @@ -23,7 +23,6 @@ from fastapi_jwt_auth import AuthJWT from pydantic import BaseModel from sqlalchemy.ext.asyncio import AsyncSession -from app.routers.editions import create_edition import datetime from app.models.question import Question from app.models.question_tag import QuestionTag