Git Product home page Git Product logo

yournextrepresentative's Introduction

A website for crowd-sourcing structured election candidate data

YourNextRepresentative is a open source platform for crowd-sourcing information about candidates for political office and making it available as open data to anyone.

The core data that YourNextRepresentative collects includes who is standing, what party they’re standing for, their contact details, their social media accounts etc. The software requires that each change is submitted with a source, so that the collected information can be independently checked.

This codebase was used for YourNextMP in the UK for the 2015 General Election, and has also been reused in Argentina, Burkina Faso, St Paul (Minnesota) and Costa Rica.

The codebase is internationalized; if you want to help to translate the project into a new language, we use Transifex to allow anyone to contribute translations.

Known Bugs

You can find a list of known issues to work on here:

These are prioritized in Waffle:

What should I read next?

The following other documentation files may be of use to you, depending on what you're trying to do:

yournextrepresentative's People

Contributors

andylolz avatar chris48s avatar chrismytton avatar dracos avatar edwardbetts avatar frabcus avatar hugovk avatar jacksonj04 avatar jarofgreen avatar lizconlan avatar martinszy avatar mhl avatar struan avatar symroe avatar tfgg avatar wfdd avatar zarino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yournextrepresentative's Issues

when editing details of a person and it's unknown if they're standing, don't mark them as definitely not standing

From @symroe

after updating her she has gone in the "known
not to be standing again" category. This is inferred by me making an edit
and not checking the 'standing in 2015' box, but I never actually stated
that she will not be standing again (I'm sure she will be, but I can't find
a source for that). Maybe we should only mark people as not standing if
there is an explicit statement to that effect?

bug: currently you can't blank out fields

So you can change a Wikipedia URL or Twitter username for a person, or add one where there was no previous value, but clearing the field and submitting it has no effect. Presumably we're not sending that field to PopIt in that case, and then PopIt's unexpected PUT behaviour (patching, not replacing) hits us...

allow photos of a candidate to be uploaded

At the moment I'm thinking that this is potentially so open to abuse (and was problematic for YourNextMP in 2010) that we'd want to restrict the users who can do it, or have a submitted photos moderation queue.

Logged in user name

Should users be able to alter how their name appears on the site? Is it possible for 2 people to register with the same user name? And does it matter?

(And do I need [an admin] to change mine?)

add a "feedback" link on each page

There are corrections that people might want to make to the site that they either can't figure out how to do, or aren't currently possible in the interface - the main one of these that strikes me is indicating that two different people should be merged (#25). If there was a feedback form on each page (as with Pombola) with a captcha, then we could collect these corrections to apply.

Add a way to indicate a 2010 candidate is standing in different constituency

In the 2010 election, Graham Lee http://yournextmp.mysociety.org/person/804 unsuccessfully stood as a candidate for Ruislip, Northwood and Pinner.

The Green Party PPC page for London (http://london.greenparty.org.uk/elections/2015-general-election.html - the last (incomplete) entry) currently has him listed for neighbouring Uxbridge and South Ruislip instead.

Assuming that the Green Party page is correct, how should we handle that? Maybe a search for candidates of the same name when creating a new candidate might be part of it (there are currently 2 "Graham Lee"s in the live data as I'd forgotten he stood elsewhere last time around - sorry - http://yournextmp.mysociety.org/person/4547 is the duplicate)

Error when updating an MP

On http://mark.candidates.dev.mysociety.org/person/stephen-williams/update I added a homepage url and twitter username (which appear to have saved correctly) but got the following error.

Environment:


Request Method: POST
Request URL: http://mark.candidates.dev.mysociety.org/person/stephen-williams/update

Django Version: 1.6.5
Python Version: 2.7.3
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django_nose',
 'pipeline',
 'candidates',
 'debug_toolbar')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')


Traceback:
File "/data/vhost/mark.candidates.dev.mysociety.org/venv/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/data/vhost/mark.candidates.dev.mysociety.org/venv/lib/python2.7/site-packages/django/views/generic/base.py" in view
  69.             return self.dispatch(request, *args, **kwargs)
File "/data/vhost/mark.candidates.dev.mysociety.org/venv/lib/python2.7/site-packages/django/views/generic/base.py" in dispatch
  87.         return handler(request, *args, **kwargs)
File "/data/vhost/mark.candidates.dev.mysociety.org/venv/lib/python2.7/site-packages/django/views/generic/edit.py" in post
  171.             return self.form_valid(form)
File "/data/vhost/mark.candidates.dev.mysociety.org/yournextmp-popit/candidates/views.py" in form_valid
  540.             person.id
File "/data/vhost/mark.candidates.dev.mysociety.org/yournextmp-popit/candidates/views.py" in set_party_membership
  254.         person = PopItPerson.create_from_popit(self.api, person_id)
File "/data/vhost/mark.candidates.dev.mysociety.org/yournextmp-popit/candidates/models.py" in create_from_popit
  79.         new_person._update_organizations()
File "/data/vhost/mark.candidates.dev.mysociety.org/yournextmp-popit/candidates/models.py" in _update_organizations
  91.         for m in self.popit_data['memberships']:

Exception Type: KeyError at /person/stephen-williams/update
Exception Value: 'memberships'

Place major parties to top of party list in admin interface

Currently the admin interface drop down selection lists all parties alphabetically. There are hundreds.

Instead it is proposed that the top five parties are listed at the top alphabetically, with the remainder beneath a dotted line:

Conservatives
Green
Labour
Lib Dem
UKIP

Indicate approved date format

When inputting a date of birth, I got a 'please enter a valid date' message, but there's no indication of the approved format.

(I'd pasted straight from Wikipedia as "December 22, 1964").

add a PPC view page (not just the "edit" page)

At the moment there's no way to see information about a candidate except by clicking "Edit" beside them (and that's only available to logged-in users). We should add even a very basic page that displays the information we have for that candidate.

login process is excessively onerous at the moment

A confirmed email address is required even if you're using social login, which is probably excessive. The reason for this at the moment is just not having found a satisfactory combination of django-allauth settings, and wanting to err on the side of discouraging any malicious users at first...

Comments from my earlier email

  1. Login with twitter is needlessly complex: we don't need to verify email,
    I don't think. (I've not tried the other methods)

Yeah, it's way over the top, but I couldn't find any other
combination of django-allauth settings that were satisfactory,
and at the moment I'm more worried about junk data being added
by time-wasters than not having enough people take part. [...]
There's some comments about that change to the authentication
here:

c119bff

As I said there, I'm tempted to ditch the social login entirely
(even though I like the idea of storing less user data), partly
to make this simpler and partly because I keep reading things
like this:

https://medium.com/on-coding/the-unexpected-costs-of-third-party-login-cda41c087653

add an "action log" table for recording what users have done

The "versions" data in PopIt helps you to see what happened to a particular candidate's record, but it doesn't provide an easy view of what particular users have done (and wouldn't record deletion of people, for example). If we get a malicious user, it would also be helpful to be able to go through all the changes they've made to revert them as well. So, a simple "action log" table would help with this.

don't allow the automatic creation of new parties

We now have a list of registered parties from the Electoral Commission in PopIt so it seems sensible just to offer those as a choice, rather than the current behaviour when anything entered that isn't the same as something in the autocomplete will cause a new party to be created. (This probably would result in lots of typo or alias parties being created.)

adding new people should use MaxPopItIds

The maximum person ID in use should now be set by the candidates_create_popit command, but currently creating new people doesn't use this information. It needs to try the ID MaxPopItIds.get_max_persons_id() + 1 first, increment it until creation succeeds, and then use MaxPopItIds.update_max_persons_id(...) to record the ID that worked.

update party emblems on the live site

Because of the way I imported the data, the image URLs all refer to localhost URLs - I've added a candidates_delete_party_images command and then we can just rerun candidates_update_popit_parties_from_ec_data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.