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

Error: '<=' not supported between instances of 'NoneType' and 'datetime.datetime' #519

Closed
RichardHyde opened this issue Jul 17, 2024 · 1 comment

Comments

@RichardHyde
Copy link

Since updating to the latest build I've been getting an error '<=' not supported between instances of 'NoneType' and 'datetime.datetime' which wasn't happening with the v0.13.6 release.

I've gotten the error from two sources, Linus Tech Tips and MKBHD, and seems to be happening when running the sync.tasks.index_source_task task.

The error message from the background_task table is

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/background_task/tasks.py", line 43, in bg_runner
    func(*args, **kwargs)
  File "/app/sync/tasks.py", line 193, in index_source_task
    media.save()
  File "/app/sync/models.py", line 918, in save
    super().save(
  File "/usr/local/lib/python3.11/dist-packages/django/db/models/base.py", line 739, in save
    self.save_base(using=using, force_insert=force_insert,
  File "/usr/local/lib/python3.11/dist-packages/django/db/models/base.py", line 787, in save_base
    post_save.send(
  File "/usr/local/lib/python3.11/dist-packages/django/dispatch/dispatcher.py", line 180, in send
    return [
           ^
  File "/usr/local/lib/python3.11/dist-packages/django/dispatch/dispatcher.py", line 181, in <listcomp>
    (receiver, receiver(signal=self, sender=sender, **named))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/sync/signals.py", line 117, in media_post_save
    skip_changed = filter_media(instance)
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/app/sync/filtering.py", line 22, in filter_media
    if filter_max_cap(instance):
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/sync/filtering.py", line 111, in filter_max_cap
    if instance.published <= max_cap_age:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<=' not supported between instances of 'NoneType' and 'datetime.datetime'

Let me know if you need any additional info, or want me to try something

@meeb meeb closed this as completed in 68de807 Jul 17, 2024
@meeb
Copy link
Owner

meeb commented Jul 17, 2024

Thanks for the issue! Again looks like this was introduced in a recent feature update and the above commit should fix it. It'll be available in :latest once the image builds. Feel free to open more issues if you encounter any more bugs, reports like this are most helpful.

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