Skip to content

Commit 216ec49

Browse files
committed
Checkpointing. Remaining work: convert meetingregistation fixup to a migration and a mgmt comment. Flesh out testing of 8989 rule 2 and fix the known edge case bug. Remove old implementation and connect UI to the new implementation.
- Legacy-Id: 18971
1 parent 445f98d commit 216ec49

File tree

8 files changed

+529
-6
lines changed

8 files changed

+529
-6
lines changed

ietf/doc/factories.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from ietf.doc.models import ( Document, DocEvent, NewRevisionDocEvent, DocAlias, State, DocumentAuthor,
1515
StateDocEvent, BallotPositionDocEvent, BallotDocEvent, BallotType, IRSGBallotDocEvent, TelechatDocEvent,
16-
DocumentActionHolder)
16+
DocumentActionHolder, DocumentAuthor)
1717
from ietf.group.models import Group
1818

1919
def draft_name_generator(type_id,group,n):
@@ -365,3 +365,14 @@ class Meta:
365365

366366
document = factory.SubFactory(WgDraftFactory)
367367
person = factory.SubFactory('ietf.person.factories.PersonFactory')
368+
369+
class DocumentAuthorFactory(factory.DjangoModelFactory):
370+
class Meta:
371+
model = DocumentAuthor
372+
373+
document = factory.SubFactory(DocumentFactory)
374+
person = factory.SubFactory('ietf.person.factories.PersonFactory')
375+
email = factory.LazyAttribute(lambda obj: obj.person.email())
376+
377+
class WgDocumentAuthorFactory(DocumentAuthorFactory):
378+
document = factory.SubFactory(WgDraftFactory)

ietf/group/factories.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
from typing import List # pyflakes:ignore
77

8-
from ietf.group.models import Group, Role, GroupEvent, GroupMilestone
8+
from ietf.group.models import Group, Role, GroupEvent, GroupMilestone, \
9+
GroupHistory, RoleHistory
910
from ietf.review.factories import ReviewTeamSettingsFactory
1011

1112
class GroupFactory(factory.DjangoModelFactory):
@@ -71,3 +72,25 @@ class DatelessGroupMilestoneFactory(BaseGroupMilestoneFactory):
7172
group = factory.SubFactory(GroupFactory, uses_milestone_dates=False)
7273
order = factory.Sequence(lambda n: n)
7374

75+
class GroupHistoryFactory(factory.DjangoModelFactory):
76+
class Meta:
77+
model=GroupHistory
78+
79+
name = factory.LazyAttribute(lambda obj: obj.group.name)
80+
state_id = 'active'
81+
type_id = factory.LazyAttribute(lambda obj: obj.group.type_id)
82+
list_email = factory.LazyAttribute(lambda obj: '%s@ietf.org'% obj.group.acronym)
83+
uses_milestone_dates = True
84+
used_roles = [] # type: List[str]
85+
86+
group = factory.SubFactory(GroupFactory)
87+
acronym = factory.LazyAttribute(lambda obj: obj.group.acronym)
88+
89+
class RoleHistoryFactory(factory.DjangoModelFactory):
90+
class Meta:
91+
model=RoleHistory
92+
93+
group = factory.SubFactory(GroupHistoryFactory)
94+
person = factory.SubFactory('ietf.person.factories.PersonFactory')
95+
email = factory.LazyAttribute(lambda obj: obj.person.email())
96+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 2.2.20 on 2021-04-22 14:32
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('nomcom', '0009_auto_20201109_0439'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='nomcom',
15+
name='first_call_for_volunteers',
16+
field=models.DateField(blank=True, null=True, verbose_name='Date of the first call for volunteers'),
17+
),
18+
]

ietf/nomcom/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class NomCom(models.Model):
5959
help_text='Display pictures of each nominee (if available) on the feedback pages')
6060
show_accepted_nominees = models.BooleanField(verbose_name='Show accepted nominees', default=True,
6161
help_text='Show accepted nominees on the public nomination page')
62+
first_call_for_volunteers = models.DateField(verbose_name='Date of the first call for volunteers', blank=True, null=True)
6263

6364
class Meta:
6465
verbose_name_plural = 'NomComs'

0 commit comments

Comments
 (0)