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

« back to all changes in this revision

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

Omit the group size limit text when there isn't one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    def add_projectset(self, req, group_size):
38
38
        """Add a new ProjectSet"""
39
39
        new_projectset = ProjectSet()
40
 
        if group_size == '':
41
 
            new_projectset.max_students_per_group = None
42
 
        else:
43
 
            new_projectset.max_students_per_group = int(group_size)
 
40
        new_projectset.max_students_per_group = int(group_size)
44
41
        new_projectset.offering = self.context
45
42
 
46
43
        req.store.add(new_projectset)
47
44
        req.store.flush()
48
45
 
49
 
        self.ctx['projectset'] = new_projectset
 
46
        self.ctx['group_size'] = new_projectset.max_students_per_group
 
47
        self.ctx['projectset_id'] = new_projectset.id
50
48
        self.ctx['projects'] = []
51
49
        self.ctx['new_project_url'] = self.new_project_url(new_projectset)
52
50