Closed
Description
Describe the bug
I added a new task in the Django Admin. For TaskType is assigned "Run once". I did not assign any value at schedule time, assigned all other values and pressed saved.
An exception was then raised:
TypeError at /admin/scheduler/task/1/change/
'<' not supported between instances of 'str' and 'datetime.datetime'
To Reproduce
Steps to reproduce the behavior:
- Go to Django Admin
- Click on 'Tasks Scheduler" -> Tasks.
- Add a new task
- assign all required values, choose TaskType "Run once" and leave the schedule time empty
- Press "Save".
Expected behavior would be that when pressing save that I cannot save a task like this as it is invalid, and it shows me a message that I need to assign the schedule timed.
This I guess should be added to the Task.clean function see here https://github.com/django-commons/django-tasks-scheduler/blob/master/scheduler/models/task.py#L436
There it already checks for the other task types but not for "Run once"