|
2 | 2 |
|
3 | 3 | from ietf.idtracker.models import Area, IETFWG |
4 | 4 | from ietf.liaisons.models import SDOs, LiaisonManagers |
5 | | -from ietf.liaisons.accounts import (is_ietfchair, is_iabchair, is_iab_executive_director, |
| 5 | +from ietf.liaisons.accounts import (is_ietfchair, is_iabchair, is_iab_executive_director, is_irtfchair, |
6 | 6 | get_ietf_chair, get_iab_chair, get_iab_executive_director, |
7 | 7 | is_secretariat) |
8 | 8 |
|
|
11 | 11 | IAB = {'name': u'The IAB', 'address': u'iab@iab.org'} |
12 | 12 | IABCHAIR = {'name': u'The IAB Chair', 'address': u'iab-chair@iab.org'} |
13 | 13 | IABEXECUTIVEDIRECTOR = {'name': u'The IAB Executive Director', 'address': u'execd@iab.org'} |
| 14 | +IRTFCHAIR = {'name': u'The IRTF Chair', 'address': u'irtf-chair@irtf.org'} |
14 | 15 |
|
15 | 16 |
|
16 | 17 | def get_all_sdo_managers(): |
@@ -88,6 +89,29 @@ def full_user_list(self): |
88 | 89 | return result |
89 | 90 |
|
90 | 91 |
|
| 92 | +class IRTFEntity(Entity): |
| 93 | + |
| 94 | + poc = FakePerson(**IRTFCHAIR) |
| 95 | + |
| 96 | + def get_from_cc(self, person): |
| 97 | + result = [] |
| 98 | + if not is_irtfchair(person): |
| 99 | + result.append(self.poc) |
| 100 | + return result |
| 101 | + |
| 102 | + def needs_approval(self, person=None): |
| 103 | + if is_irtfchair(person): |
| 104 | + return False |
| 105 | + return True |
| 106 | + |
| 107 | + def can_approve(self): |
| 108 | + return [self.poc] |
| 109 | + |
| 110 | + def full_user_list(self): |
| 111 | + result.append(get_irtf_chair()) |
| 112 | + return result |
| 113 | + |
| 114 | + |
91 | 115 | class IABEntity(Entity): |
92 | 116 | chair = FakePerson(**IABCHAIR) |
93 | 117 | director = FakePerson(**IABEXECUTIVEDIRECTOR) |
@@ -270,6 +294,26 @@ def can_approve_list(self, person): |
270 | 294 | return [] |
271 | 295 |
|
272 | 296 |
|
| 297 | +class IRTFEntityManager(EntityManager): |
| 298 | + |
| 299 | + def __init__(self, *args, **kwargs): |
| 300 | + super(IRTFEntityManager, self).__init__(*args, **kwargs) |
| 301 | + self.entity = IRTFEntity(name=self.name) |
| 302 | + |
| 303 | + def get_entity(self, pk=None): |
| 304 | + return self.entity |
| 305 | + |
| 306 | + def can_send_on_behalf(self, person): |
| 307 | + if is_irtfchair(person): |
| 308 | + return self.get_managed_list() |
| 309 | + return [] |
| 310 | + |
| 311 | + def can_approve_list(self, person): |
| 312 | + if is_irtfchair(person): |
| 313 | + return self.get_managed_list() |
| 314 | + return [] |
| 315 | + |
| 316 | + |
273 | 317 | class AreaEntityManager(EntityManager): |
274 | 318 |
|
275 | 319 | def __init__(self, pk=None, name=None, queryset=None): |
@@ -358,6 +402,7 @@ def __init__(self): |
358 | 402 | self.managers = {'ietf': IETFEntityManager(pk='ietf', name=u'The IETF'), |
359 | 403 | 'iesg': IETFEntityManager(pk='iesg', name=u'The IESG'), |
360 | 404 | 'iab': IABEntityManager(pk='iab', name=u'The IAB'), |
| 405 | + 'irtf': IRTFEntityManager(pk='irtf', name=u'The IAB'), |
361 | 406 | 'area': AreaEntityManager(pk='area', name=u'IETF Areas'), |
362 | 407 | 'wg': WGEntityManager(pk='wg', name=u'IETF Working Groups'), |
363 | 408 | 'sdo': SDOEntityManager(pk='sdo', name=u'Standards Development Organizations'), |
|
0 commit comments