fix import error with wagtail 1.7
This commit is contained in:
parent
f0f55176df
commit
934eaf1b74
|
@ -60,6 +60,15 @@ External applications:
|
||||||
You must write a settings.py file in the `instance` directory (you can just
|
You must write a settings.py file in the `instance` directory (you can just
|
||||||
copy and paste `instance/sample_settings.py`.
|
copy and paste `instance/sample_settings.py`.
|
||||||
|
|
||||||
|
You will need to define a secret key, and eventually update the list of allowed hosts:
|
||||||
|
|
||||||
|
```
|
||||||
|
# django's project secret key (mandatory; you can find generators online)
|
||||||
|
SECRET_KEY = ''
|
||||||
|
# list of allowed hosts
|
||||||
|
ALLOWED_HOSTS = [ '127.0.0.1:8042' ]
|
||||||
|
```
|
||||||
|
|
||||||
You also want to redefine the following variable (required by Wagtail for the CMS):
|
You also want to redefine the following variable (required by Wagtail for the CMS):
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
|
@ -503,6 +503,9 @@ class Schedule(models.Model):
|
||||||
otherwise.
|
otherwise.
|
||||||
If the schedule is ponctual, return None.
|
If the schedule is ponctual, return None.
|
||||||
"""
|
"""
|
||||||
|
if self.frequency == Schedule.Frequency.ponctual:
|
||||||
|
return False
|
||||||
|
|
||||||
# since we care only about the week, go to the same day of the week
|
# since we care only about the week, go to the same day of the week
|
||||||
date = date_or_default(date)
|
date = date_or_default(date)
|
||||||
date += tz.timedelta(days = self.date.weekday() - date.weekday() )
|
date += tz.timedelta(days = self.date.weekday() - date.weekday() )
|
||||||
|
@ -531,6 +534,9 @@ class Schedule(models.Model):
|
||||||
"""
|
"""
|
||||||
Return a list with all matching dates of date.month (=today)
|
Return a list with all matching dates of date.month (=today)
|
||||||
"""
|
"""
|
||||||
|
if self.frequency == Schedule.Frequency.ponctual:
|
||||||
|
return []
|
||||||
|
|
||||||
date = date_or_default(date, True).replace(day=1)
|
date = date_or_default(date, True).replace(day=1)
|
||||||
freq = self.frequency
|
freq = self.frequency
|
||||||
|
|
||||||
|
@ -580,6 +586,9 @@ class Schedule(models.Model):
|
||||||
|
|
||||||
If exclude_saved, exclude all diffusions that are yet in the database.
|
If exclude_saved, exclude all diffusions that are yet in the database.
|
||||||
"""
|
"""
|
||||||
|
if self.frequency == Schedule.Frequency.ponctual:
|
||||||
|
return []
|
||||||
|
|
||||||
dates = self.dates_of_month(date)
|
dates = self.dates_of_month(date)
|
||||||
diffusions = []
|
diffusions = []
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from wagtail.wagtailimages.utils import generate_signature
|
from wagtail.wagtailimages.views.serve import generate_signature, verify_sign ature
|
||||||
|
|
||||||
|
|
||||||
def image_url(image, filter_spec):
|
def image_url(image, filter_spec):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user