linuxsoftware / ls.joyous

A calendar application for Wagtail
BSD 3-Clause "New" or "Revised" License
74 stars 35 forks source link

Fix for Holidays v0.13 #47

Closed paperreduction closed 2 years ago

paperreduction commented 2 years ago

See issue #44

paperreduction commented 2 years ago

Just a quick explanation as to what happened between holidays 0.12 and 0.13:

holidays/__init__.py used to only import the countries and some constants. It now imports additional utilities and all the base base classes in holiday_base.py (including HolidaySum).

_createMap() in joyous was trying to take everything in holidays that inherited from HolidayBase and make a dict out of it. This crashed when encountering the HolidaySum class that is now being added to the list due to the above import changes. The HolidaySum class should not be considered for the dict mapping.

My change is designed to import the countries directly for the construction of the mapping dict. I left the existing filter logic in place, however, it is probably unnecessary at this point.

Hopefully that makes sense of why I changed what I did. And if you don't like the patch, this gives you some details for your own correction.

linuxsoftware commented 2 years ago

Thank you very much for your work on this. I have merged it in.