Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Paused job's next_run_time is None #77

Closed
heng-zhang-20 opened this issue Jul 6, 2020 · 1 comment
Closed

Paused job's next_run_time is None #77

heng-zhang-20 opened this issue Jul 6, 2020 · 1 comment

Comments

@heng-zhang-20
Copy link

If a job was paused by Scheduler like this BackgroundScheduler().pause_job(job_id="5140"), this job's next_run_time attribution is None, then function next_run_time_sec(self, obj) in class DjangoJobAdmin() will raise an error AttributeError: 'NoneType' object has no attribute 'month'. Therefor you'd better deal with it like this:

# djago_apscheduler/admin.py
def next_run_time_sec(self, obj):
    return util.localize(obj.next_run_time)

# here 
def next_run_time_sec(self, obj):
    if obj.next_run_time:
        return util.localize(obj.next_run_time)
@jcass77
Copy link
Owner

jcass77 commented Jul 16, 2020

It looks like this was fixed in #68, which is included in the recently released v0.3.1.

@jcass77 jcass77 closed this as completed Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants