Skip to content

Commit 4806a52

Browse files
committed
Improve Position proxy to return proxied ADs (with a functioning is_current_ad), fixes ietf-tools#782.
- Legacy-Id: 4018
1 parent 679fd4f commit 4806a52

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

ietf/doc/proxy.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def active_positions(self):
583583
res.append(dict(ad=IESGLoginProxy().from_object(ad), pos=Position().from_object(pos) if pos else None))
584584

585585
res.sort(key=lambda x: x["ad"].last_name)
586-
586+
587587
return res
588588

589589
def needed(self, standardsTrack=True):
@@ -820,7 +820,7 @@ class Meta:
820820
class Position(BallotPositionDocEvent):
821821
def from_object(self, base):
822822
for f in base._meta.fields:
823-
if not f.name in ('discuss',): # don't overwrite properties
823+
if not f.name in ('discuss', "ad"): # don't overwrite properties
824824
setattr(self, f.name, getattr(base, f.name))
825825

826826
self.orig = base
@@ -832,6 +832,11 @@ def ballot(self):
832832
return self.doc # FIXME: doesn't emulate old interface
833833

834834
# ad = models.ForeignKey(IESGLogin) # same name
835+
@property
836+
def ad(self):
837+
from ietf.person.proxy import IESGLogin
838+
return IESGLogin().from_object(self.orig.ad if hasattr(self, "orig") else super(Position, self).ad)
839+
835840
#yes = models.IntegerField(db_column='yes_col')
836841
@property
837842
def yes(self):

0 commit comments

Comments
 (0)