{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/airmozilla/issues/347","labels_url":"https://api.github.com/repos/mozilla/airmozilla/issues/347/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/airmozilla/issues/347/comments","events_url":"https://api.github.com/repos/mozilla/airmozilla/issues/347/events","html_url":"https://github.com/mozilla/airmozilla/pull/347","id":85611282,"number":347,"title":"For review: Initial draft of attempt ","user":{"login":"blossomica","id":6190813,"avatar_url":"https://avatars.githubusercontent.com/u/6190813?v=3","gravatar_id":"","url":"https://api.github.com/users/blossomica","html_url":"https://github.com/blossomica","followers_url":"https://api.github.com/users/blossomica/followers","following_url":"https://api.github.com/users/blossomica/following{/other_user}","gists_url":"https://api.github.com/users/blossomica/gists{/gist_id}","starred_url":"https://api.github.com/users/blossomica/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blossomica/subscriptions","organizations_url":"https://api.github.com/users/blossomica/orgs","repos_url":"https://api.github.com/users/blossomica/repos","events_url":"https://api.github.com/users/blossomica/events{/privacy}","received_events_url":"https://api.github.com/users/blossomica/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-06-05T19:14:30Z","updated_at":"2015-06-11T17:34:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/airmozilla/pulls/347","html_url":"https://github.com/mozilla/airmozilla/pull/347","diff_url":"https://github.com/mozilla/airmozilla/pull/347.diff","patch_url":"https://github.com/mozilla/airmozilla/pull/347.patch"},"body":"@peterbe - This is not functional right now. I'll remove the prints from it later on and we said the html suppose to be on event.html, opposed to it being a new file as I did, but I didn't really do that. I'ld like to have some feedback on this on if it is going towards the right direction or it is totally off. Thank you :)"},"comment":{"url":"https://api.github.com/repos/mozilla/airmozilla/issues/comments/111216725","html_url":"https://github.com/mozilla/airmozilla/pull/347#issuecomment-111216725","issue_url":"https://api.github.com/repos/mozilla/airmozilla/issues/347","id":111216725,"user":{"login":"peterbe","id":26739,"avatar_url":"https://avatars.githubusercontent.com/u/26739?v=3","gravatar_id":"","url":"https://api.github.com/users/peterbe","html_url":"https://github.com/peterbe","followers_url":"https://api.github.com/users/peterbe/followers","following_url":"https://api.github.com/users/peterbe/following{/other_user}","gists_url":"https://api.github.com/users/peterbe/gists{/gist_id}","starred_url":"https://api.github.com/users/peterbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterbe/subscriptions","organizations_url":"https://api.github.com/users/peterbe/orgs","repos_url":"https://api.github.com/users/peterbe/repos","events_url":"https://api.github.com/users/peterbe/events{/privacy}","received_events_url":"https://api.github.com/users/peterbe/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T17:34:59Z","updated_at":"2015-06-11T17:34:59Z","body":"What I meant about the query is basically this:\r\n\r\nWhen we index events we need to index them under \"public\", \"contributors\" or \"company\". \r\n\r\nWhen an anonymous user visits the related_content view it should do a fancy more_like_this query against ES but it should ALWAYS require that privacy=public. \r\n\r\nWhen a Mozillian contributor signs in, it too should do a fancy more_like_this query against ES but it HAS NOT filter on `privacy==public OR privacy==contributors`. \r\n\r\nWhen a signed in non-contributor signs in and searches, you can ignore the whole filtering on privacy. \r\n\r\nA good example of seeing this logic might just be the home page: https://github.com/mozilla/airmozilla/blob/master/airmozilla/main/views.py#L88-L96\r\n\r\nTake a couple of minutes to study that code to get a feel for what it does. That code is all about the Django ORM but you're going to need to do the equivalent with an ES query. "}}