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

added_date_object is not a python date? #16

Open
philomatic opened this issue Nov 24, 2023 · 0 comments
Open

added_date_object is not a python date? #16

philomatic opened this issue Nov 24, 2023 · 0 comments

Comments

@philomatic
Copy link

Stating in the docs, added_date_object should be a python date.
But it seems that it does not return a date object, instead a datetime.
The match clause:

match: "{{ added_date_object > date.today() - timedelta(days=2) }}"

results in the following error:

[2023-11-24 09:28:19,163] [WARNING] [paperless.consumer] TypeError: can't compare datetime.datetime to datetime.date

Unfortunately, we can't use datetime as it's not known:

match: "{{ added_date_object > datetime.now() - timedelta(days=2) }}"

gives:

[2023-11-24 09:30:31,962] [WARNING] [paperless.consumer] jinja2.exceptions.UndefinedError: 'datetime' is undefined

I'm not very talented in python, maybe i'm missing something?

Best regards

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

1 participant