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

« back to all changes in this revision

Viewing changes to ivle/database.py

Merge from submissions-admin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
379
379
 
380
380
        return enrolment
381
381
 
 
382
    def get_students(self):
 
383
        enrolments = self.enrolments.find(role=u'student')
 
384
        return [enrolment.user for enrolment in enrolments]
 
385
 
382
386
class Enrolment(Storm):
383
387
    """An enrolment of a user in an offering.
384
388
 
438
442
    def get_permissions(self, user):
439
443
        return self.offering.get_permissions(user)
440
444
 
 
445
    # Get the individuals (groups or users) Assigned to this project
 
446
    def get_assigned(self):
 
447
        #If its a Solo project, return everyone in offering
 
448
        if self.max_students_per_group is None:
 
449
            return self.offering.get_students()
 
450
        else:
 
451
            return self.project_groups
 
452
 
441
453
class Project(Storm):
442
454
    """A student project for which submissions can be made."""
443
455