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

AttributeError: 'NoneType' object has no attribute 'astimezone' from @@querybuilder_html_results #13

Closed
zopyx opened this issue Jun 2, 2020 · 4 comments

Comments

@zopyx
Copy link
Member

zopyx commented Jun 2, 2020

Plone 5.2.1

Create a new collection and select a date criteria and switch to a relative date.
This causes an error related to @@querybuilder_html_results:

2020-06-02 14:05:13,628 ERROR   [Zope.SiteErrorLog:251][waitress] 1591099513.62749550.1922243698514261 http://dev2.zopyx.de:20081/plone_portal/@@querybuilder_html_results
Traceback (innermost last):
  Module ZPublisher.WSGIPublisher, line 156, in transaction_pubevents
  Module ZPublisher.WSGIPublisher, line 338, in publish_module
  Module ZPublisher.WSGIPublisher, line 256, in publish
  Module ZPublisher.mapply, line 85, in mapply
  Module ZPublisher.WSGIPublisher, line 62, in call_object
  Module plone.app.querystring.querybuilder, line 107, in html_results
  Module plone.app.querystring.querybuilder, line 98, in __call__
  Module plone.app.querystring.querybuilder, line 170, in _makequery
  Module Products.CMFPlone.CatalogTool, line 457, in searchResults
  Module Products.ZCatalog.ZCatalog, line 611, in searchResults
  Module Products.ZCatalog.Catalog, line 1091, in searchResults
  Module Products.ZCatalog.Catalog, line 634, in search
  Module Products.ZCatalog.Catalog, line 564, in _search_index
  Module Products.PluginIndexes.unindex, line 483, in query_index
  Module Products.DateRecurringIndex.index, line 157, in _convert
  Module plone.event.utils, line 551, in dt2int
  Module plone.event.utils, line 253, in utc
AttributeError: 'NoneType' object has no attribute 'astimezone'

@petschki
Copy link
Member

petschki commented Dec 14, 2021

Just got bitten by this too. I fixed it by converting my start query from string to datetime object. Obviously the pytd call in utils here https://github.com/plone/plone.event/blob/master/plone/event/utils.py#L252 gets None if you pass in a date string.

/cc @thet you may have a idea how to fix this?

@gogobd
Copy link
Contributor

gogobd commented Jan 13, 2023

Just ran into the same issue today...

gogobd added a commit that referenced this issue Jan 13, 2023
jensens added a commit that referenced this issue Jan 13, 2023
@mauritsvanrees
Copy link
Sponsor Member

The PR from @gogobd was merged and I released plone.event 1.4.2 with it. Thanks!

@mauritsvanrees
Copy link
Sponsor Member

This version will be in the Plone 5.2.11 and 6.0.1 releases that I am starting to prepare.

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

4 participants