Skip to content

Registration Application Control Endpoints #48

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: fastapi
Choose a base branch
from

Conversation

ThunderRoar
Copy link
Member

  • Allow flexible controls over application time range.

@ThunderRoar ThunderRoar requested a review from conrad-mo May 1, 2025 02:58
@conrad-mo
Copy link
Member

conrad-mo commented May 1, 2025

In models/forms.py line 27, we already have a model for storing application deadline whose design I grabbed from last year's.

class Forms_Form(SQLModel, table=True):
    id: uuid.UUID = Field(
        default_factory=uuid.uuid4,
        primary_key=True,
    )
    start_at: datetime = Field(
        sa_column=Column(DateTime(timezone=True), nullable=False)
    )
    end_at: datetime = Field(sa_column=Column(DateTime(timezone=True), nullable=False))

There is also a function in utils.py line 138 to get application deadline.

async def isValidSubmissionTime(session: SessionDep):
    time = session.exec(select(Forms_Form).limit(1)).first()
    if time is None:
        return False
    return time.start_at < datetime.now(timezone.utc) < time.end_at

Need to delete Forms_ApplicationTimeRange and instead use this model because some checks already rely on this. If you want to add new columns, you can modify the model above. Change the routes in admins/forms.py to reflect this as well.

@ThunderRoar
Copy link
Member Author

ThunderRoar commented May 1, 2025

I will update the model Forms_Form that was created last year for the current endpoints. The one mentioned in utils.py is used for check for valid application submission time. I will update accordingly and push the changes.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants