Skip to content

Job does not exists error get ovverriden by Invalid task type error #354

@developernext

Description

@developernext

Describe the bug
In scheduler.models.task the function get_scheduled_task raise the wrong error when a task is not found.

To Reproduce

  1. Have a valid task of type CronTaskType
  2. Open a django shell
  3. import the function and it's dependecies
  4. run get_scheduled_task using the right type and id
  5. update the id to a non existing one
  6. you get

Traceback (most recent call last):
File "", line 1, in
File "", line 11, in get_scheduled_task
ValueError: Invalid task type CronTaskType

Expected behavior
You should get Job does not exists error

Desktop (please complete the following information):

  • OS: Ubuntu 24.04
  • python version: 3.12
  • django version: 5.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions