def METHOD_NAME(
    project: "models.Project", user: "models.User"
) -> "models.PackageJob":
    if not project.project_filename:
        raise exceptions.NoQGISProjectError()
    if project.needs_repackaging:
        package_job = repackage(project, user)
    else:
        package_job = (
            models.PackageJob.objects.filter(project=project)
            .order_by("started_at")
            .get()
        )
    return package_job