Skip to content

Commit e4bed79

Browse files
committed
Fix timestamp on imported charters
- Legacy-Id: 3893
1 parent 6b75ce8 commit e4bed79

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

redesign/importing/import-groups.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -339,15 +339,6 @@ def import_date_event(group, name, state_id, desc):
339339
l = ""
340340
group.list_archive = l
341341

342-
charter = set_or_create_charter(group)
343-
if group.state_id in ("active", "conclude"):
344-
charter.rev = "01"
345-
charter.set_state(State.objects.get(type="charter", slug="approved"))
346-
else:
347-
charter.rev = "00"
348-
charter.set_state(State.objects.get(type="charter", slug="notrev"))
349-
charter.save()
350-
351342
group.comments = o.comments.strip() if o.comments else ""
352343

353344
group.save()
@@ -399,5 +390,17 @@ def import_date_event(group, name, state_id, desc):
399390
import_date_event(group, "concluded", "conclude", "Concluded group")
400391
# dormant_date is empty on all so don't bother with that
401392

393+
charter = set_or_create_charter(group)
394+
if group.state_id in ("active", "conclude"):
395+
charter.rev = "01"
396+
charter.set_state(State.objects.get(type="charter", slug="approved"))
397+
else:
398+
charter.rev = "00"
399+
charter.set_state(State.objects.get(type="charter", slug="notrev"))
400+
# the best estimate of the charter time is when we changed state
401+
e = group.groupevent_set.order_by("-time")[:1]
402+
charter.time = e[0].time if e else group.time
403+
charter.save()
404+
402405
# FIXME: missing fields from old: meeting_scheduled, email_keyword, meeting_scheduled_old
403406

0 commit comments

Comments
 (0)