Compare commits
3 Commits
f226d3cac6
...
9652024852
Author | SHA1 | Date |
---|---|---|
Jean-Marie Favreau | 9652024852 | |
Jean-Marie Favreau | 2d157c29ec | |
Jean-Marie Favreau | a8aaece180 |
|
@ -4,7 +4,7 @@ import warnings
|
||||||
from icalendar import vDatetime
|
from icalendar import vDatetime
|
||||||
import bbcode
|
import bbcode
|
||||||
|
|
||||||
from datetime import datetime, date
|
from datetime import datetime, date, timedelta
|
||||||
from bs4 import BeautifulSoup, MarkupResemblesLocatorWarning
|
from bs4 import BeautifulSoup, MarkupResemblesLocatorWarning
|
||||||
|
|
||||||
from .extractor import *
|
from .extractor import *
|
||||||
|
@ -67,6 +67,12 @@ class ICALExtractor(Extractor):
|
||||||
start_day, start_time = self.get_dt_item_from_vevent(event, "DTSTART")
|
start_day, start_time = self.get_dt_item_from_vevent(event, "DTSTART")
|
||||||
|
|
||||||
end_day, end_time = self.get_dt_item_from_vevent(event, "DTEND")
|
end_day, end_time = self.get_dt_item_from_vevent(event, "DTEND")
|
||||||
|
|
||||||
|
# if the start and end are only defined by dates (and not times),
|
||||||
|
# then the event does not occurs on the last day (because it is the end
|
||||||
|
# of the event...)
|
||||||
|
if not start_time and not end_time and start_day != end_day:
|
||||||
|
end_day = end_day + timedelta(days=-1)
|
||||||
|
|
||||||
location = self.get_item_from_vevent(event, "LOCATION")
|
location = self.get_item_from_vevent(event, "LOCATION")
|
||||||
if location is None:
|
if location is None:
|
||||||
|
|
|
@ -463,7 +463,6 @@ class Event(models.Model):
|
||||||
if not self.exact_location:
|
if not self.exact_location:
|
||||||
for p in Place.objects.all():
|
for p in Place.objects.all():
|
||||||
if p.match(self):
|
if p.match(self):
|
||||||
logger.warning("Found a place for an imported event: " + p.name)
|
|
||||||
self.exact_location = p
|
self.exact_location = p
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ Mettre l'événement {{ event.title }} à la corbeille
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
{{ form }}
|
{{ form }}
|
||||||
<div class="grid">
|
<div class="grid buttons">
|
||||||
<a href="{{ cancel_url }}" role="button" class="secondary">Annuler</a>
|
<a href="{{ cancel_url }}" role="button" class="secondary">Annuler</a>
|
||||||
<input type="submit" value="Confirmer">
|
<input type="submit" value="Confirmer">
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue