Skip to content

Grace period logic needs tidying #15

Description

@keysmashes

The logic around project uploads, the grace period, etc. is in need of some looking at.

For example, the time left for each student to reupload their project is determined by looking up the time at which the job to end the grace period will run:

job = scheduler.get_job(f"grace_deadline_{project.id}")
grace_time = None
if job:
grace_time = job.next_run_time.strftime('%Y-%m-%d %H:%M')

and whilst there's nothing actually wrong with this (in normal use, the grace_deadline job sets a flag that prevents the frontend from querying this API endpoint), it would be a lot nicer if the calculation of "when should the grace period end" was separated from the actual action of scheduling the job to end it.

It also looks like there has been some miscommunication and/or indecision about how the grace period should actually work, as there's a lot of copy in the frontend about having 3 days after you upload the project to reupload it, whereas the backend schedules the grace_deadline job for either 1 or 3 days after the final upload deadline, depending on the rotation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions