Skip to content

Commit

Permalink
Merge pull request #130 from barqshasbite/master
Browse files Browse the repository at this point in the history
Prevent AttributeError when lock date is None.
  • Loading branch information
maxim-kht authored Jun 5, 2018
2 parents fe05441 + 4f373bc commit 1ab1f82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_cron/backends/lock/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def get_cache_timeout(self, cron_class):

def get_running_lock_date(self):
date = self.cache.get(self.lock_name)
if not timezone.is_aware(date):
if date and not timezone.is_aware(date):
tz = timezone.get_current_timezone()
date = timezone.make_aware(date, tz)
return date

0 comments on commit 1ab1f82

Please sign in to comment.