mysociety / yournextrepresentative

A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk/
GNU Affero General Public License v3.0
56 stars 21 forks source link

Missing UK 2010 general election candidate memberships #934

Closed struan closed 8 years ago

struan commented 8 years ago

Terese Coffey and Tom Greatrex are missing candidate memberships for the 2010 election.

mhl commented 8 years ago

The dynamic election adding on the DC fork makes this slightly awkward, because it only lets you add candidacies of posts in current elections. We could mark the 2010 election current briefly, in order to make it available to choose again, but it might be easier to put them back in the Django shell - the following seems to work for me:

$ ./manage.py shell_plus
[...]
In [1]: election = Election.objects.get(slug='2010')

In [2]: person = Person.objects.get(name='Therese Coffey')

In [3]: post = Post.objects.get(label='Member of Parliament for Suffolk Coastal')

In [4]: party = Organization.objects.get(name__contains='Conservative and Unionist', party_sets__slug='gb')

In [5]: m = Membership.objects.create(role='Candidate', person=person, on_behalf_of=party, post=post)

In [6]: MembershipExtra.objects.create(base=m, elected=True, election=election)
Out[6]: <MembershipExtra: MembershipExtra object>

In [7]: person = Person.objects.get(name='Tom Greatrex')

In [8]: post = Post.objects.get(label='Member of Parliament for Rutherglen and Hamilton West')

In [9]: party = Organization.objects.get(name='Labour and Co-operative Party', party_sets__slug='gb')

In [10]: m = Membership.objects.create(role='Candidate', person=person, on_behalf_of=party, post=post)

In [11]: MembershipExtra.objects.create(base=m, elected=True, election=election)
Out[11]: <MembershipExtra: MembershipExtra object>
mhl commented 8 years ago

@symroe Do you mind if I run the above on the DC server?