Skip to content

Courses re-factor#186

Closed
g-bar wants to merge 74 commits into
mainfrom
courses-part2
Closed

Courses re-factor#186
g-bar wants to merge 74 commits into
mainfrom
courses-part2

Conversation

@g-bar

@g-bar g-bar commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Sorry for the big diff, most of it is tests, but excluding the tests folder should be manageable.

  • This refactors existing course functionality. Creats a separate Course table to keep it separate from vlabs that are not assigned to courses.
  • Creates institution and course endpoints.

Future PRs will implement the seat management system

@g-bar g-bar changed the title Courses part2 Courses re-factor Jun 8, 2026
@g-bar g-bar requested review from bilalesi and pgetta June 8, 2026 15:21
@g-bar g-bar marked this pull request as ready for review June 8, 2026 15:21

@bilalesi bilalesi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i left few comments, will check it more deep this afternoon

Comment thread virtual_labs/domain/institution.py Outdated
Comment thread virtual_labs/domain/institution.py Outdated
admins: list[UUID4] | None = None
owner: ShortenedUser | None = None

@model_serializer(mode="wrap")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use VirtualLabWithAdmins.model_dump(exclude_none=True) when needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you had that, but Pydantic does for nested models too.

For the course object nested in the lab, if you do this (exclude_none=True), ti will exclude the start_date, we don't want that.

class CourseOut(BaseModel):
    model_config = ConfigDict(from_attributes=True)

    id: UUID4
    virtual_lab_id: UUID4
    institution_id: UUID4
    template_project_id: UUID4
    status: str
    start_date: Optional[date] = None
    end_date: Optional[date] = None
    last_drop_date: Optional[date] = None

@bilalesi

bilalesi commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

it would be great if you can generate a .md file that explain how things with institution and courses works

@g-bar

g-bar commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

it would be great if you can generate a .md file that explain how things with institution and courses works

Added, will expand with next PR explaining seat management.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/safety/auth/main.py:6: AuthlibDeprecationWarning: authlib.jose module is deprecated, please use joserfc instead.
It will be compatible before version 2.0.0.
from authlib.jose import jwt

poetry audit report

Loading...
Scanning 105 packages...

No vulnerabilities found ✨✨

@g-bar g-bar requested a review from bilalesi June 23, 2026 09:19
@g-bar

g-bar commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

I included this branch and the fixes in : #187

so closing,

@g-bar g-bar closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants