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

« back to all changes in this revision

Viewing changes to ivle/webapp/submit/__init__.py

  • Committer: William Grant
  • Date: 2009-05-05 06:37:51 UTC
  • Revision ID: grantw@unimelb.edu.au-20090505063751-wd4uof95xy6xesfl
Ensure that the path is absolute when submitting a project.
mod_dav_svn requires an absolute path.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
        # We need to work out which entity owns the repository, so we look
44
44
        # at the first two path segments. The first tells us the type.
45
45
        self.context = self.get_repository_owner(req.store, name)
 
46
 
 
47
        # Ensure that the path is absolute (required for SVNAuthzFile).
46
48
        # XXX Re-convert to unicode (os.path.normpath(u"/") returns a str).
47
 
        self.path = unicode(os.path.normpath(path))
 
49
        self.path = os.path.join(u"/", unicode(os.path.normpath(path)))
48
50
 
49
51
        if self.context is None:
50
52
            raise NotFound()
114
116
            Offering.semester_id == Semester.id,
115
117
            Semester.state == u'current',
116
118
            Offering.subject_id == Subject.id,
117
 
            Subject.short_name == self.path.split('/')[0],
 
119
            Subject.short_name == self.path.split('/')[1],
118
120
            ).one()
119
121
 
120
122