response = HttpResponse()
url = settings.MEDIA_URL + filename
- # let nginx determine the correct content type
- response['Content-Type'] = ""
+ # let nginx determine the correct content type
+ response['Content-Type'] = ""
response['X-Accel-Redirect'] = url
return response
# Rolling publishing date : public access is automaticcaly given when time between recorded year
# and current year is over the settings value PUBLIC_ACCESS_PERIOD and if item.auto_period_access == True
-
+
if user.is_staff or user.is_superuser or user.has_perm('telemeta.can_play_all_items'):
access = 'full'
access = item.collection.public_access
elif not user.is_authenticated() and item.collection.public_access == 'mixed':
- access = item.public_access
+ access = item.public_access
- # Auto publish after slipping period (settings.TELEMETA_PUBLIC_ACCESS_PERIOD)
+ # Auto publish after a period given at settings.TELEMETA_PUBLIC_ACCESS_PERIOD
if access != 'full' and item.auto_period_access:
year_from = str(item.recorded_from_date).split('-')[0]
year_to = str(item.recorded_to_date).split('-')[0]
year_now = datetime.datetime.now().strftime("%Y")
if int(year_now) - int(year) >= settings.TELEMETA_PUBLIC_ACCESS_PERIOD:
access = 'full'
-
+
return access
def get_revisions(nb, user=None):