app/soc/views/models/mentor.py
changeset 3029 3c09b9396e2e
parent 2919 cb677410c0f1
child 3032 f3886d1b00a5
equal deleted inserted replaced
3028:1852a74ba03a 3029:3c09b9396e2e
    26 from django import forms
    26 from django import forms
    27 from django.utils.translation import ugettext
    27 from django.utils.translation import ugettext
    28 
    28 
    29 from soc.logic import dicts
    29 from soc.logic import dicts
    30 from soc.logic.models import organization as org_logic
    30 from soc.logic.models import organization as org_logic
       
    31 from soc.logic.models import student as student_logic
    31 from soc.views.helper import access
    32 from soc.views.helper import access
    32 from soc.views.helper import decorators
    33 from soc.views.helper import decorators
    33 from soc.views.helper import dynaform
    34 from soc.views.helper import dynaform
    34 from soc.views.helper import redirects
    35 from soc.views.helper import redirects
    35 from soc.views.helper import params as params_helper
    36 from soc.views.helper import params as params_helper
    58     rights['edit'] = [('checkIsMyActiveRole', soc.logic.models.mentor.logic)]
    59     rights['edit'] = [('checkIsMyActiveRole', soc.logic.models.mentor.logic)]
    59     rights['delete'] = ['checkIsDeveloper']
    60     rights['delete'] = ['checkIsDeveloper']
    60     rights['invite'] = [('checkHasActiveRoleForScope',
    61     rights['invite'] = [('checkHasActiveRoleForScope',
    61                          soc.logic.models.org_admin.logic)]
    62                          soc.logic.models.org_admin.logic)]
    62     rights['accept_invite'] = [('checkCanCreateFromRequest', 'mentor'),
    63     rights['accept_invite'] = [('checkCanCreateFromRequest', 'mentor'),
    63         'checkIsNotStudentForProgramOfOrg']
    64         ('checkIsNotStudentForProgramOfOrg', [org_logic.logic,
    64     rights['request'] = ['checkIsNotStudentForProgramOfOrg',
    65                                               student_logic.logic])]
       
    66     rights['request'] = [
       
    67         ('checkIsNotStudentForProgramOfOrg',
       
    68             [org_logic.logic, student_logic.logic]),
    65         ('checkCanMakeRequestToGroup', org_logic)]
    69         ('checkCanMakeRequestToGroup', org_logic)]
    66     rights['process_request'] = [
    70     rights['process_request'] = [
    67         ('checkHasActiveRoleForScope', soc.logic.models.org_admin.logic),
    71         ('checkHasActiveRoleForScope', soc.logic.models.org_admin.logic),
    68         ('checkCanProcessRequest', 'mentor')]
    72         ('checkCanProcessRequest', 'mentor')]
    69     rights['manage'] = [
    73     rights['manage'] = [