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

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/projectservice.py

  • Committer: Matt Giuca
  • Date: 2010-02-23 05:18:48 UTC
  • Revision ID: matt.giuca@gmail.com-20100223051848-8kxdsitlvkeyl4gt
Added handlers and documentation for Subversion status 'ignored' (we call them 'Temporary file (ignored)'. This was previously handled as an 'unknown status'. Ignored files now can't have svn actions done on them either. This fixes Launchpad bug #526220.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import ivle.database
22
22
from ivle.database import ProjectSet, Project, Subject, Semester, Offering
23
23
 
24
 
from ivle.webapp.base.forms import VALID_URL_NAME
25
24
from ivle.webapp.base.rest import (XHTMLRESTView, named_operation,
26
25
                                   require_permission)
27
26
from ivle.webapp.errors import NotFound, BadRequest
42
41
    @named_operation('edit')
43
42
    def add_project(self, req, name, short_name, deadline, synopsis):
44
43
        """Add a Project to this ProjectSet"""
45
 
        if not VALID_URL_NAME.match(short_name):
46
 
            raise BadRequest(
47
 
                "Project names must consist of an alphanumeric character "
48
 
                "followed by any number of alphanumerics, ., + or -.")
49
 
 
50
 
        if req.store.find(
51
 
            Project,
52
 
            Project.short_name == unicode(short_name),
53
 
            Project.project_set_id == ProjectSet.id,
54
 
            ProjectSet.offering == self.context.offering).one():
55
 
            raise BadRequest(
56
 
                "A project with that URL name already exists in this offering."
57
 
                )
58
 
 
59
44
        new_project = Project()
60
45
        new_project.name = unicode(name)
61
46
        new_project.short_name = unicode(short_name)