author | Lennard de Rijk <ljvderijk@gmail.com> |
Sat, 24 Oct 2009 15:14:11 -0700 | |
changeset 3036 | c703f3802841 |
parent 2676 | a7fabd1534f8 |
permissions | -rw-r--r-- |
1121
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
2 |
# |
1307
091a21cf3627
Update the copyright notice for 2009.
Sverre Rabbelier <srabbelier@gmail.com>
parents:
1121
diff
changeset
|
3 |
# Copyright 2009 the Melange authors. |
1121
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
4 |
# |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
8 |
# |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
10 |
# |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
16 |
|
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
17 |
"""Mentor (Model) query functions. |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
18 |
""" |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
19 |
|
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
20 |
__authors__ = [ |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
21 |
'"Lennard de Rijk" <ljvderijk@gmail.com>', |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
22 |
] |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
23 |
|
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
24 |
|
1982
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
25 |
from google.appengine.ext import db |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
26 |
|
1121
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
27 |
from soc.logic.models import role |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
28 |
from soc.logic.models import organization as org_logic |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
29 |
|
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
30 |
import soc.models.mentor |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
31 |
import soc.models.role |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
32 |
|
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
33 |
|
1972
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
34 |
DEF_ALREADY_MENTORING_RPOJECT_MSG = "This Mentor is mentoring a Student "\ |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
35 |
"Project and can therefore not be resigned. Please assign another Mentor." |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
36 |
|
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
37 |
DEF_ALREADY_MENTORING_PROPOSAL_MSG = "This Mentor is mentoring a Student "\ |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
38 |
"Proposal and can therefore not be resigned. Please assign another Mentor." |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
39 |
|
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
40 |
|
1121
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
41 |
class Logic(role.Logic): |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
42 |
"""Logic methods for the Mentor model. |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
43 |
""" |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
44 |
|
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
45 |
def __init__(self, model=soc.models.mentor.Mentor, |
1955
06ed84dbb1ed
Moved canResign check to role logic so subclasses can override.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1307
diff
changeset
|
46 |
base_model=soc.models.role.Role, scope_logic=org_logic, |
2664
06d4f4d06f64
Added registerRole to Role Logic where all roles are registered.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2072
diff
changeset
|
47 |
role_name='mentor', disallow_last_resign=False): |
1121
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
48 |
"""Defines the name, key_name and model for this entity. |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
49 |
""" |
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
50 |
|
2673
cecb3a669527
Added missing role_name to org_admin Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2672
diff
changeset
|
51 |
super(Logic, self).__init__(model=model, base_model=base_model, |
cecb3a669527
Added missing role_name to org_admin Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2672
diff
changeset
|
52 |
scope_logic=scope_logic, |
cecb3a669527
Added missing role_name to org_admin Logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2672
diff
changeset
|
53 |
role_name=role_name, |
1955
06ed84dbb1ed
Moved canResign check to role logic so subclasses can override.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1307
diff
changeset
|
54 |
disallow_last_resign=disallow_last_resign) |
1121
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
55 |
|
1972
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
56 |
def canResign(self, entity): |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
57 |
"""Checks if the Mentor is able to resign. |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
58 |
|
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
59 |
Checks if there are no Student Proposals or Student Projects that |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
60 |
have this mentor assigned to it. |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
61 |
|
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
62 |
Args: |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
63 |
entity: a Mentor entity |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
64 |
|
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
65 |
""" |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
66 |
|
2072
eb4565a8e5b4
Style fixes and removal of unused imports in soc.logic.models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1982
diff
changeset
|
67 |
from soc.logic.models.student_project import logic as \ |
eb4565a8e5b4
Style fixes and removal of unused imports in soc.logic.models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1982
diff
changeset
|
68 |
student_project_logic |
eb4565a8e5b4
Style fixes and removal of unused imports in soc.logic.models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1982
diff
changeset
|
69 |
from soc.logic.models.student_proposal import logic as \ |
eb4565a8e5b4
Style fixes and removal of unused imports in soc.logic.models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1982
diff
changeset
|
70 |
student_proposal_logic |
1972
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
71 |
|
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
72 |
fields = {'mentor': entity} |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
73 |
|
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
74 |
student_project_entity = student_project_logic.getForFields(fields, |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
75 |
unique=True) |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
76 |
if student_project_entity: |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
77 |
return DEF_ALREADY_MENTORING_RPOJECT_MSG |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
78 |
|
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
79 |
student_proposal_entity = student_proposal_logic.getForFields(fields, |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
80 |
unique=True) |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
81 |
|
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
82 |
if student_proposal_entity: |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
83 |
return DEF_ALREADY_MENTORING_PROPOSAL_MSG |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
84 |
|
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
85 |
return super(Logic, self).canResign(entity) |
5f1e3b5262cb
Mentors cant resign when mentoring a project/proposal.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1955
diff
changeset
|
86 |
|
1982
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
87 |
def _updateField(self, entity, entity_properties, name): |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
88 |
"""Called when the fields of the mentor are updated |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
89 |
|
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
90 |
When status is changed to invalid, removes the Mentor from all Student |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
91 |
Proposals possible mentor lists. |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
92 |
""" |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
93 |
|
2072
eb4565a8e5b4
Style fixes and removal of unused imports in soc.logic.models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1982
diff
changeset
|
94 |
from soc.logic.models.student_proposal import logic \ |
eb4565a8e5b4
Style fixes and removal of unused imports in soc.logic.models modules.
Pawel Solyga <Pawel.Solyga@gmail.com>
parents:
1982
diff
changeset
|
95 |
as student_proposal_logic |
1982
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
96 |
|
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
97 |
value = entity_properties[name] |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
98 |
|
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
99 |
if name == 'status' and value != entity.status and value == 'invalid': |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
100 |
fields = {'org': entity.scope} |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
101 |
|
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
102 |
# TODO make this work for more then 1000 entities |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
103 |
proposals_query = student_proposal_logic.getQueryForFields(fields) |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
104 |
|
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
105 |
# store all updated proposals |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
106 |
changed = [] |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
107 |
|
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
108 |
for proposal in proposals_query: |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
109 |
|
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
110 |
if proposal.possible_mentors.count(entity.key()): |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
111 |
# remove from list and add to changed |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
112 |
proposal.possible_mentors.remove(entity.key()) |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
113 |
changed.append(proposal) |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
114 |
|
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
115 |
# store all changed proposals |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
116 |
db.put(changed) |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
117 |
|
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
118 |
return super(Logic, self)._updateField(entity, entity_properties, name) |
d3bebec883f1
Removes the Mentor from all Student Proposals possible mentor lists when resigning.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
1972
diff
changeset
|
119 |
|
2676
a7fabd1534f8
Added sendNewRequestNotification to the Notifications helper.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2673
diff
changeset
|
120 |
def getRoleLogicsToNotifyUponNewRequest(self): |
2672
7bc9d3b962af
Added getRoleLogicsToNotifyUponeNewRequest for use with notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2664
diff
changeset
|
121 |
"""Returns a list with OrgAdmin logic which can be used to notify all |
7bc9d3b962af
Added getRoleLogicsToNotifyUponeNewRequest for use with notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2664
diff
changeset
|
122 |
appropriate Organization Admins. |
7bc9d3b962af
Added getRoleLogicsToNotifyUponeNewRequest for use with notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2664
diff
changeset
|
123 |
""" |
7bc9d3b962af
Added getRoleLogicsToNotifyUponeNewRequest for use with notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2664
diff
changeset
|
124 |
|
7bc9d3b962af
Added getRoleLogicsToNotifyUponeNewRequest for use with notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2664
diff
changeset
|
125 |
from soc.logic.models.org_admin import logic as org_admin_logic |
7bc9d3b962af
Added getRoleLogicsToNotifyUponeNewRequest for use with notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2664
diff
changeset
|
126 |
|
7bc9d3b962af
Added getRoleLogicsToNotifyUponeNewRequest for use with notifications.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2664
diff
changeset
|
127 |
return [org_admin_logic] |
1121
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
128 |
|
77c602de9248
Added mentor and org_admin logic.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
diff
changeset
|
129 |
logic = Logic() |