Closed mhl closed 7 years ago
The elections found via that method are:
{u'local.doncaster.edenthorpe-and-kirk-sandall.2016-05-05',
u'local.glasgow.anderston-city.2016-05-05',
u'local.gloucestershire.churchdown.2016-05-05',
u'local.staffordshire.uttoxeter-town.2016-05-05',
u'local.suffolk.bixley.2016-05-05',
u'local.suffolk.haverhill-cangle.2016-05-05',
u'local.surrey.staines-south-and-ashford-west.2016-05-05',
u'local.swansea.mynyddbach.2016-05-05',
u'local.wiltshire.amesbury-east.2016-05-05'}
This is nearly the same list as you get from:
In [63]: [e.slug for e in Election.objects.filter(posts__isnull=True)]
Out[63]:
[u'local.wiltshire.amesbury-east.2016-05-05',
u'local.suffolk.haverhill-cangle.2016-05-05',
u'local.surrey.staines-south-and-ashford-west.2016-05-05',
u'local.swansea.mynyddbach.2016-05-05',
u'local.doncaster.edenthorpe-and-kirk-sandall.2016-05-05',
u'local.castle-point.st-georges.2016-05-05',
u'local.glasgow.anderston-city.2016-05-05',
u'local.staffordshire.uttoxeter-town.2016-05-05',
u'local.suffolk.bixley.2016-05-05',
u'local.gloucestershire.churchdown.2016-05-05']
... except that that also includes u'local.castle-point.st-georges.2016-05-05'
This has been fixed now (see https://github.com/DemocracyClub/yournextrepresentative/issues/51 )
The error emails we've been getting from candidates.dc are an exciting new type of data inconsistency :( A
MembershipExtra
has a election, but at the moment that's not constrained to be an election that the post is linked with, via the PostExtraElection join model:Ideally there should be constraints to stop this happening, and the check could be added to: https://github.com/DemocracyClub/yournextrepresentative/blob/9d3d7287c98c2be76b8981039d408003950107e8/candidates/models/constraints.py
And these individual cases should be fixed.