~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/media.py

  • Committer: William Grant
  • Date: 2010-02-18 03:31:47 UTC
  • Revision ID: grantw@unimelb.edu.au-20100218033147-z1es9tzrx7eg85gu
Ensure that we always close the DB connection at request termination, even in the case of an exception.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
            return os.path.join(plugindir, mediadir, self.path)
95
95
 
96
96
class MediaFileView(BaseView):
97
 
    def authorize(self, req):
98
 
        return True
 
97
    permission = None
99
98
 
100
99
    def render(self, req):
101
100
        # If it begins with ".." or separator, it's illegal. Die.
131
130
    def get_filename(self, req):
132
131
        return self.context.filename
133
132
 
 
133
    def get_permissions(self, user, config):
 
134
        return set()
 
135
 
134
136
def root_to_media(root, *segments):
135
137
    if segments[0].startswith('+'):
136
138
        if segments[0] == '+external':