<s> from __future__ import absolute_import , unicode_literals <EOL> from django . http import Http404 <EOL> from django . shortcuts import get_object_or_404 , redirect <EOL> from . models import File <EOL> def canonical ( request , uploaded_at , file_id ) : <EOL> """<STR_LIT>""" <EOL> filer_file = get_object_or_404 ( File , pk = file_id , is_public = True ) <EOL> if ( uploaded_at != filer_file . uploaded_at . strftime ( '<STR_LIT:%s>' ) or <EOL> not filer_file . file ) : <EOL> raise Http404 ( '<STR_LIT>' % File . _meta . object_name ) <EOL> return redirect ( filer_file . url ) </s>
