Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32 update model attributes #34

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b390f6c
add changes of user and university models
emrdagkusu Mar 6, 2022
d54f354
update university models and lesson section logic
emrdagkusu Mar 6, 2022
cda1ba5
update semester start hour
emrdagkusu Mar 12, 2022
6cb69e0
update section logic from integer list to model
emrdagkusu Mar 12, 2022
6ca7c18
remove id from section slots
emrdagkusu Mar 12, 2022
947db65
update slot and absence logic
emrdagkusu Mar 12, 2022
31e8f4f
sort absences while adding
emrdagkusu Mar 12, 2022
a307d5c
update slot order while adding/updating slots
emrdagkusu Mar 12, 2022
5a8c346
update order of sections and slots while adding/updating sections
emrdagkusu Mar 12, 2022
54491b8
do not let creating new university lesson with same code
emrdagkusu Mar 13, 2022
e3f8fd7
add new attriubutes and routers to user and semester
emrdagkusu Mar 13, 2022
26cc8ec
add router for updating universities with new attributes
emrdagkusu Mar 13, 2022
92f3570
update model for admin user
emrdagkusu Mar 13, 2022
42a7f63
update university tests after changing model attributes
emrdagkusu Mar 13, 2022
8d56af0
add user/semester and user/user router tests
shiny-apricot Mar 14, 2022
cda647a
Add user/lesson tests.
shiny-apricot Mar 15, 2022
f8d043b
Add user/slot_routers tests.
shiny-apricot Mar 16, 2022
88a3d55
let empty room for slots
emrdagkusu Mar 17, 2022
eefa6ec
Generate openapi.json
emrdagkusu Mar 17, 2022
0e20779
let fields in update models optional
emrdagkusu Mar 19, 2022
ac75ab1
Merge branch '32-update-model-attributes' of github.com:hbusul/kucukd…
emrdagkusu Mar 19, 2022
c451494
Generate openapi.json
emrdagkusu Mar 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion backend/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ RUN pip install --no-cache-dir -r requirements.test.txt
COPY . .
COPY --from=scheduler-builder /tmp/_scheduler.so /tmp/scheduler.py ./

CMD [ "pytest" ]
# run the tests with verbose

CMD [ "pytest" ,"-vv"]
10 changes: 5 additions & 5 deletions backend/app/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
async def create_admin_user(request: Request):
if await request["users"].find_one({"email": settings.ADMIN_USERNAME}) is None:
user = UserModel(
email=settings.ADMIN_USERNAME, password=bcrypt.hash(settings.ADMIN_PASSWORD)
email=settings.ADMIN_USERNAME,
password=bcrypt.hash(settings.ADMIN_PASSWORD),
first_name="Admin",
last_name="User",
)
user = jsonable_encoder(user)
user["userGroup"] = "admin"
user["curSemesterID"] = "null"
user["curUniversityID"] = "null"
user["entranceYear"] = 0
user["user_group"] = "admin"
res = await request["users"].insert_one(user)
if res.inserted_id is None:
raise HTTPException(status_code=500, detail="Could not create admin user")
Expand Down
2 changes: 2 additions & 0 deletions backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from .routers.university_routers.uni_semester_routers import (
router as uni_semester_router,
)
from .routers.user_routers.slot_routers import router as slot_router
from .routers.user_routers.lesson_routers import router as lesson_router
from .routers.user_routers.semester_routers import router as semester_router
from .routers.user_routers.user_routers import router as user_router
Expand Down Expand Up @@ -63,6 +64,7 @@ async def shutdown_db_client():
app.include_router(user_router, tags=["users"], prefix="/users")
app.include_router(semester_router, tags=["semesters"], prefix="/users")
app.include_router(lesson_router, tags=["lessons"], prefix="/users")
app.include_router(slot_router, tags=["slots"], prefix="/users")
app.include_router(uni_router, tags=["universities"], prefix="/universities")
app.include_router(
uni_semester_router, tags=["university semesters"], prefix="/universities"
Expand Down
Loading