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

« back to all changes in this revision

Viewing changes to ivle/webapp/tutorial/exercise_service.py

  • Committer: William Grant
  • Date: 2010-02-23 09:00:25 UTC
  • mto: This revision was merged to the branch mainline in revision 1674.
  • Revision ID: grantw@unimelb.edu.au-20100223090025-0c5r577z9fa56od9
Fix validation messages to inform users that alphanumerics in names must be lowercase.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    def add_exercise(self, req, identifier, name, description, partial, solution, include, num_rows):
51
51
        if not VALID_URL_NAME.match(identifier):
52
52
            raise BadRequest(
53
 
                "Exercise names must consist of an alphanumeric character "
54
 
                "followed by any number of alphanumerics, ., +, - or _.")
 
53
                "Exercise names must consist of a lowercase alphanumeric "
 
54
                "character followed by any number of lowercase alphanumerics, "
 
55
                "., +, - or _.")
55
56
 
56
57
        if req.store.find(Exercise, id=unicode(identifier)).one():
57
58
            raise BadRequest("An exercise with that URL name already exists.")