소스 검색

Merge branch 'dev' into release/0.25

Vince Salvino 2 년 전
부모
커밋
983208fa91
5개의 변경된 파일27개의 추가작업 그리고 5개의 파일을 삭제
  1. 10 3
      coderedcms/models/page_models.py
  2. 1 0
      docs/releases/index.rst
  3. 1 1
      docs/releases/v0.25.1.rst
  4. 14 0
      docs/releases/v0.25.2.rst
  5. 1 1
      setup.py

+ 10 - 3
coderedcms/models/page_models.py

@@ -8,6 +8,8 @@ import os
 import warnings
 from datetime import date, datetime
 from typing import Dict, List, Optional, TYPE_CHECKING, Union
+# This is a requirement for icalendar, even if django doesn't require it
+import pytz
 
 import geocoder
 from django import forms
@@ -840,7 +842,12 @@ class CoderedEventPage(CoderedWebPage, BaseEvent):
         # Return the event instances, possibly spliced if num_instances_to_return is set.
         return event_instances[:num_of_instances_to_return] if num_of_instances_to_return else event_instances  # noqa
 
-    def convert_to_ical_format(self, dt_start=None, dt_end=None, occurrence=None):
+    def convert_to_ical_format(
+        self,
+        dt_start: datetime = None,
+        dt_end: datetime = None,
+        occurrence=None,
+    ):
         ical_event = ICalEvent()
         ical_event.add('summary', self.title)
         # needs to get full page url, not just slug
@@ -858,12 +865,12 @@ class CoderedEventPage(CoderedWebPage, BaseEvent):
 
         if dt_start:
             # Convert to utc to remove timezone confusion
-            dt_start = dt_start.astimezone(timezone.utc)
+            dt_start = dt_start.astimezone(pytz.utc)
             ical_event.add('dtstart', dt_start)
 
             if dt_end:
                 # Convert to utc to remove timezone confusion
-                dt_end = dt_end.astimezone(timezone.utc)
+                dt_end = dt_end.astimezone(pytz.utc)
                 ical_event.add('dtend', dt_end)
 
             # Add a reminder alarm

+ 1 - 0
docs/releases/index.rst

@@ -22,6 +22,7 @@ Wagtail CRX (previously CodeRed CMS) follows the
 .. toctree::
     :maxdepth: 1
 
+    v0.25.2
     v0.25.1
     v0.25.0
     v0.24.1

+ 1 - 1
docs/releases/v0.25.1.rst

@@ -6,7 +6,7 @@ Bug fixes
 ---------
 
 * Correct generation of .ics files to be consistent with the iCal format, fixing
-  compatability with Outlook for Mac and other highly compliant software.
+  compatibility with Outlook for Mac and other highly compliant software.
 
 
 Thank you!

+ 14 - 0
docs/releases/v0.25.2.rst

@@ -0,0 +1,14 @@
+v0.25.2 release notes
+=====================
+
+
+Bug fixes
+---------
+
+* Additional bug fixes related to dates in icalendar file generation.
+
+
+Thank you!
+----------
+
+Thanks to everyone who contributed to `0.25.2 on GitHub <https://github.com/coderedcorp/coderedcms/milestone/42?closed=1>`_.

+ 1 - 1
setup.py

@@ -48,7 +48,7 @@ setup(
         'django-bootstrap4==22.1',
         'Django>=3.2,<4.1',             # should be the same as wagtail
         'geocoder==1.38.*',
-        'icalendar==4.0.*',
+        'icalendar==4.1.*',
         'wagtail==2.16.*',
         'wagtail-cache==1.*',
         'wagtail-seo==1.*',