mysociety / popit

DEPRECATED - Development on PopIt has stopped and it is no longer being maintained
https://goo.gl/Vvej4Q
Other
76 stars 33 forks source link

uploaded images are missing proxy_url from elements of the images array #811

Closed mhl closed 9 years ago

mhl commented 9 years ago

Since the recent image changes, newly uploaded images seem to be missing proxy_url from the elements of the images array. (The top-level proxy_image is still there and working, though.)

e.g. it's missing from images[0] in all of these:

For example, the JSON for the first one is:


{
  "result": {
    "proxy_image": "http://yournextmp.popit.mysociety.org/image-proxy/http%3A%2F%2Fyournextmp.popit.mysociety.org%2Fpersons%2F4549%2Fimage%2F55191b404ff096f44902d235",
    "image": "http://yournextmp.popit.mysociety.org/persons/4549/image/55191b404ff096f44902d235",
    "birth_date": "1971-07-06",
    "email": "matttaylor2000@hotmail.com",
    "gender": "male",
    "honorific_prefix": "Sir",
    "honorific_suffix": null,
    "html_url": "http://yournextmp.popit.mysociety.org/persons/4549",
    "id": "4549",
    "name": "Matt Taylor",
    "party_memberships": {
      "2015": {
        "id": "ynmp-party:2",
        "name": "Independent"
      }
    },
    "standing_in": {
      "2015": {
        "post_id": "65844",
        "name": "Brighton, Kemptown",
        "mapit_url": "http://mapit.mysociety.org/area/65844"
      }
    },
    "url": "http://yournextmp.popit.mysociety.org/api/v0.1/persons/4549",
    "versions": [
      {
        "information_source": "Approved a photo upload from vote4matttaylor2015 who provided the message: \"\"",
        "timestamp": "2015-03-30T09:45:37.374112",
        "username": "mark",
        "data": {
          "facebook_page_url": "",
          "identifiers": [],
          "proxy_image": null,
          "name": "Matt Taylor",
          "honorific_suffix": null,
          "party_ppc_page_url": "",
          "gender": "male",
          "image": null,
          "linkedin_url": "",
          "homepage_url": "http://www.sosparty.co.uk/",
          "id": "4549",
          "honorific_prefix": "Sir",
          "standing_in": {
            "2015": {
              "post_id": "65844",
              "name": "Brighton, Kemptown",
              "mapit_url": "http://mapit.mysociety.org/area/65844"
            }
          },
          "facebook_personal_url": "",
          "twitter_username": "sosleader",
          "wikipedia_url": "",
          "party_memberships": {
            "2015": {
              "id": "ynmp-party:2",
              "name": "Independent"
            }
          },
          "birth_date": "1971-07-06",
          "other_names": [],
          "email": "matttaylor2000@hotmail.com"
        },
        "version_id": "200f90d9fdf3095c"
      },
      {
        "information_source": "I am Matt Taylor",
        "timestamp": "2015-03-23T15:10:20.334527",
        "username": "vote4matttaylor2015",
        "data": {
          "facebook_page_url": "",
          "gender": "male",
          "name": "Matt Taylor",
          "honorific_suffix": "",
          "party_ppc_page_url": "",
          "other_names": [],
          "image": null,
          "identifiers": [],
          "facebook_personal_url": "",
          "proxy_image": null,
          "email": "matttaylor2000@hotmail.com",
          "honorific_prefix": "Sir",
          "linkedin_url": "",
          "homepage_url": "http://www.sosparty.co.uk/",
          "twitter_username": "sosleader",
          "standing_in": {
            "2015": {
              "post_id": "65844",
              "name": "Brighton, Kemptown",
              "mapit_url": "http://mapit.mysociety.org/area/65844"
            }
          },
          "wikipedia_url": "",
          "party_memberships": {
            "2015": {
              "name": "Independent",
              "id": "ynmp-party:2"
            }
          },
          "birth_date": "1971-07-06",
          "id": "4549"
        },
        "version_id": "5d738618748a6e43"
      },
      {
        "username": "Sussexonian",
        "timestamp": "2015-03-02T20:42:48.313094",
        "information_source": "Give him the benefit of the doubt -website is confused whether Kemptown or Lewes though.",
        "data": {
          "twitter_username": "sosleader",
          "name": "Matt Taylor",
          "honorific_suffix": "",
          "party_ppc_page_url": "",
          "gender": "male",
          "image": null,
          "identifiers": [],
          "facebook_personal_url": "",
          "proxy_image": null,
          "other_names": [],
          "honorific_prefix": "",
          "linkedin_url": "",
          "homepage_url": "http://www.sosparty.co.uk/",
          "id": "4549",
          "standing_in": {
            "2015": {
              "post_id": "65844",
              "name": "Brighton, Kemptown",
              "mapit_url": "http://mapit.mysociety.org/area/65844"
            }
          },
          "wikipedia_url": "",
          "party_memberships": {
            "2015": {
              "name": "Independent",
              "id": "ynmp-party:2"
            }
          },
          "birth_date": null,
          "facebook_page_url": "",
          "email": "matttaylor2000@hotmail.com"
        },
        "version_id": "17f3bf25df85a3e8"
      },
      {
        "username": "Sussexonian",
        "timestamp": "2015-03-02T20:38:20.897854",
        "information_source": "Reverting to version 4c077fd7603e60f6 because…",
        "data": {
          "facebook_page_url": "",
          "name": "Matt Taylor",
          "party_ppc_page_url": "",
          "facebook_personal_url": "",
          "image": null,
          "identifiers": [],
          "linkedin_url": "",
          "proxy_image": null,
          "other_names": [],
          "twitter_username": "sosleader",
          "standing_in": {
            "2015": {
              "post_id": "65844",
              "name": "Brighton, Kemptown",
              "mapit_url": "http://mapit.mysociety.org/area/65844"
            }
          },
          "homepage_url": "http://www.sosparty.co.uk/",
          "party_memberships": {
            "2015": {
              "name": "Brighton & Hove Independents",
              "id": "party:578"
            }
          },
          "id": "4549",
          "wikipedia_url": "",
          "gender": "male",
          "birth_date": null,
          "email": "matttaylor2000@hotmail.com"
        },
        "version_id": "7cff36eceb8bdf8d"
      },
      {
        "username": "Sussexonian",
        "timestamp": "2015-03-02T20:35:43.970412",
        "information_source": "1) B&H Indeps no longer exists.  2) His site also says he's standing in Lewes",
        "data": {
          "twitter_username": "sosleader",
          "name": "Matt Taylor",
          "honorific_suffix": "",
          "party_ppc_page_url": "",
          "facebook_personal_url": "",
          "image": null,
          "identifiers": [],
          "linkedin_url": "",
          "proxy_image": null,
          "other_names": [],
          "honorific_prefix": "",
          "homepage_url": "http://www.sosparty.co.uk/",
          "id": "4549",
          "wikipedia_url": "",
          "gender": "male",
          "birth_date": null,
          "facebook_page_url": "",
          "email": "matttaylor2000@hotmail.com"
        },
        "version_id": "4247e0e8782ab9ef"
      },
      {
        "username": "myf",
        "timestamp": "2015-02-18T14:26:40.814131",
        "information_source": "On his website",
        "data": {
          "facebook_page_url": "",
          "name": "Matt Taylor",
          "party_ppc_page_url": "",
          "facebook_personal_url": "",
          "image": null,
          "identifiers": [],
          "linkedin_url": "",
          "proxy_image": null,
          "other_names": [],
          "twitter_username": "sosleader",
          "standing_in": {
            "2015": {
              "post_id": "65844",
              "name": "Brighton, Kemptown",
              "mapit_url": "http://mapit.mysociety.org/area/65844"
            }
          },
          "homepage_url": "http://www.sosparty.co.uk/",
          "party_memberships": {
            "2015": {
              "name": "Brighton & Hove Independents",
              "id": "party:578"
            }
          },
          "id": "4549",
          "wikipedia_url": "",
          "gender": "male",
          "birth_date": null,
          "email": "matttaylor2000@hotmail.com"
        },
        "version_id": "4c077fd7603e60f6"
      },
      {
        "username": "myf",
        "information_source": "http://www.sosparty.co.uk/",
        "ip": "81.100.118.123",
        "version_id": "2d2661fef7b1123d",
        "timestamp": "2014-11-26T11:25:22.232356",
        "data": {
          "facebook_page_url": "",
          "name": "Matt Taylor",
          "party_ppc_page_url": "",
          "gender": "male",
          "facebook_personal_url": "",
          "id": "4549",
          "twitter_username": "sosleader",
          "standing_in": {
            "2015": {
              "post_id": "65844",
              "name": "Brighton, Kemptown",
              "mapit_url": "http://mapit.mysociety.org/area/65844"
            }
          },
          "homepage_url": "http://www.sosparty.co.uk/",
          "wikipedia_url": "",
          "party_memberships": {
            "2015": {
              "name": "Brighton & Hove Independents",
              "id": "party:578"
            }
          },
          "birth_date": null,
          "email": ""
        }
      }
    ],
    "images": [
      {
        "url": "http://yournextmp.popit.mysociety.org/persons/4549/image/55191b404ff096f44902d235",
        "mime_type": "image/png",
        "uploaded_by_user": "vote4matttaylor2015",
        "moderator_why_allowed": "profile-photo",
        "md5sum": "977f2579c645358958e967909fffbb70",
        "notes": "Approved from photo moderation queue",
        "user_why_allowed": "profile-photo",
        "index": "first",
        "created": "",
        "local_path": "55/19/55191b404ff096f44902d235",
        "local_path_base": "55/19/55191b404ff096f44902d235",
        "start_date": null,
        "end_date": null,
        "birth_date": null,
        "death_date": null,
        "founding_date": null,
        "dissolution_date": null,
        "id": "55191b404ff096f44902d235"
      }
    ],
    "memberships": [
      {
        "html_url": "http://yournextmp.popit.mysociety.org/memberships/55191b4c484f8ff449eb06c0",
        "url": "http://yournextmp.popit.mysociety.org/api/v0.1/memberships/55191b4c484f8ff449eb06c0",
        "person_id": "4549",
        "organization_id": "ynmp-party:2",
        "start_date": "2010-05-07",
        "end_date": "9999-12-31",
        "id": "55191b4c484f8ff449eb06c0",
        "images": [],
        "links": [],
        "contact_details": []
      },
      {
        "html_url": "http://yournextmp.popit.mysociety.org/memberships/55191b4c484f8ff449eb06c1",
        "url": "http://yournextmp.popit.mysociety.org/api/v0.1/memberships/55191b4c484f8ff449eb06c1",
        "person_id": "4549",
        "post_id": "65844",
        "role": "Candidate",
        "start_date": "2010-05-07",
        "end_date": "9999-12-31",
        "id": "55191b4c484f8ff449eb06c1",
        "images": [],
        "links": [],
        "contact_details": []
      }
    ],
    "links": [
      {
        "note": "homepage",
        "url": "http://www.sosparty.co.uk/",
        "id": "55191b44484f8ff449eb06be"
      }
    ],
    "contact_details": [
      {
        "type": "twitter",
        "value": "sosleader",
        "id": "55191b44484f8ff449eb06bf"
      }
    ],
    "identifiers": [],
    "other_names": []
  }
}
chrismytton commented 9 years ago

A fix for this has now been deployed to production. :tada: