aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--__init__.py2
-rw-r--r--feeds.py16
2 files changed, 13 insertions, 5 deletions
diff --git a/__init__.py b/__init__.py
index 71cc55e..3dcdeff 100644
--- a/__init__.py
+++ b/__init__.py
@@ -13,7 +13,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with celcatsanitizer. If not, see <http://www.gnu.org/licenses/>.
-VERSION = "0.12.2-pa1ch"
+VERSION = "0.12.3"
__version__ = VERSION
default_app_config = "edt.apps.EdtConfig"
diff --git a/feeds.py b/feeds.py
index da077f0..c92445f 100644
--- a/feeds.py
+++ b/feeds.py
@@ -21,7 +21,7 @@ from django.db.models.functions import ExtractWeek, ExtractYear
from django.template import loader
from django.urls import reverse
from django.utils.feedgenerator import Atom1Feed, SyndicationFeed
-from django.utils.timezone import localtime
+from django.utils.timezone import get_current_timezone_name
from icalendar import Calendar, Event
@@ -40,6 +40,11 @@ class IcalFeedGenerator(SyndicationFeed):
calendar = Calendar()
calendar.add("prodid", "-//celcatsanitizer//NONSGML v1.0//EN")
calendar.add("version", "2.0")
+ calendar.add("calscale", "GREGORIAN")
+ calendar.add("method", "PUBLISH")
+ calendar.add("x-wr-timezone", get_current_timezone_name())
+ calendar.add("x-wr-calname", self.feed["title"])
+ calendar.add("x-wr-caldesc", self.feed["title"])
self.write_events(calendar)
outfile.write(calendar.to_ical())
@@ -86,12 +91,15 @@ class IcalFeed(Feed):
def item_extra_kwargs(self, item):
return {"uid": "{0}@celcatsanitizer".format(item.id),
- "dtstart": localtime(item.begin),
- "dtend": localtime(item.end),
- "dtstamp": localtime(item.last_update),
+ "dtstart": item.begin,
+ "dtend": item.end,
+ "dtstamp": item.last_update,
"summary": self.item_summary(item),
"location": format_rooms(item.rooms.all())}
+ def title(self, obj):
+ return "Emploi du temps du groupe {0}".format(obj)
+
class IcalOnlyOneFeed(IcalFeed):
def items(self, obj):