{"action":"created","comment":{"url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/comments/27296260","id":27296260,"diff_hunk":"@@ -19,12 +19,27 @@\n log = logging.getLogger(__name__)  # pylint: disable=invalid-name\n \n \n+sites = {\n+    'presence_mean_times' : ['Presence mean time','mean_time_weekday.html'],\n+    'presence_weekday' : ['Presence by weekday','presence_weekday.html'],\n+    'presence_start_end' : ['Presence start-end','presence_start_end.html'],\n+}\n+\n @app.route('/')\n def mainpage():\n     \"\"\"\n     Redirects to front page.\n     \"\"\"\n-    return redirect('/static/presence_weekday.html')\n+    return redirect('/presence_weekday')\n+\n+\n+@app.route('/<template>')\n+def viewer(template):\n+    \"\"\"\n+    Redirects to template view\n+    \"\"\"\n+    site = sites[template]\n+    return render_template(site[1], selected = site[0], base = sites)","path":"src/presence_analyzer/views.py","position":34,"original_position":34,"commit_id":"784ccba8d0f751865327141d9097ae1c0662b531","original_commit_id":"784ccba8d0f751865327141d9097ae1c0662b531","user":{"login":"pkucmus","id":6347418,"avatar_url":"https://avatars.githubusercontent.com/u/6347418?v=3","gravatar_id":"","url":"https://api.github.com/users/pkucmus","html_url":"https://github.com/pkucmus","followers_url":"https://api.github.com/users/pkucmus/followers","following_url":"https://api.github.com/users/pkucmus/following{/other_user}","gists_url":"https://api.github.com/users/pkucmus/gists{/gist_id}","starred_url":"https://api.github.com/users/pkucmus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkucmus/subscriptions","organizations_url":"https://api.github.com/users/pkucmus/orgs","repos_url":"https://api.github.com/users/pkucmus/repos","events_url":"https://api.github.com/users/pkucmus/events{/privacy}","received_events_url":"https://api.github.com/users/pkucmus/received_events","type":"User","site_admin":false},"body":"Better but you will get a 500 server error if a non existing template is requested.\r\n+ you could do it all not having that `sites` list\r\nHint: \r\n```python\r\ntry: \r\n    # ?\r\nexcept SomekindOfTemplateException:\r\n    # ?\r\n```","created_at":"2015-03-27T13:59:05Z","updated_at":"2015-03-27T13:59:05Z","html_url":"https://github.com/stxnext-kindergarten/presence-analyzer-pwodzinski/pull/4#discussion_r27296260","pull_request_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/comments/27296260"},"html":{"href":"https://github.com/stxnext-kindergarten/presence-analyzer-pwodzinski/pull/4#discussion_r27296260"},"pull_request":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/4","id":32022202,"html_url":"https://github.com/stxnext-kindergarten/presence-analyzer-pwodzinski/pull/4","diff_url":"https://github.com/stxnext-kindergarten/presence-analyzer-pwodzinski/pull/4.diff","patch_url":"https://github.com/stxnext-kindergarten/presence-analyzer-pwodzinski/pull/4.patch","issue_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/issues/4","number":4,"state":"open","locked":false,"title":"[bug_5810] Converted static site to templates","user":{"login":"pwodzinski","id":11503090,"avatar_url":"https://avatars.githubusercontent.com/u/11503090?v=3","gravatar_id":"","url":"https://api.github.com/users/pwodzinski","html_url":"https://github.com/pwodzinski","followers_url":"https://api.github.com/users/pwodzinski/followers","following_url":"https://api.github.com/users/pwodzinski/following{/other_user}","gists_url":"https://api.github.com/users/pwodzinski/gists{/gist_id}","starred_url":"https://api.github.com/users/pwodzinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwodzinski/subscriptions","organizations_url":"https://api.github.com/users/pwodzinski/orgs","repos_url":"https://api.github.com/users/pwodzinski/repos","events_url":"https://api.github.com/users/pwodzinski/events{/privacy}","received_events_url":"https://api.github.com/users/pwodzinski/received_events","type":"User","site_admin":false},"body":"https://bugzilla.stxnext.pl/show_bug.cgi?id=5810","created_at":"2015-03-26T14:29:03Z","updated_at":"2015-03-27T13:59:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3f5243b594dcdfc3d76f6260e98557d2967a091","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/4/commits","review_comments_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/4/comments","review_comment_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/issues/4/comments","statuses_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/statuses/784ccba8d0f751865327141d9097ae1c0662b531","head":{"label":"pwodzinski:bug_5810","ref":"bug_5810","sha":"784ccba8d0f751865327141d9097ae1c0662b531","user":{"login":"pwodzinski","id":11503090,"avatar_url":"https://avatars.githubusercontent.com/u/11503090?v=3","gravatar_id":"","url":"https://api.github.com/users/pwodzinski","html_url":"https://github.com/pwodzinski","followers_url":"https://api.github.com/users/pwodzinski/followers","following_url":"https://api.github.com/users/pwodzinski/following{/other_user}","gists_url":"https://api.github.com/users/pwodzinski/gists{/gist_id}","starred_url":"https://api.github.com/users/pwodzinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwodzinski/subscriptions","organizations_url":"https://api.github.com/users/pwodzinski/orgs","repos_url":"https://api.github.com/users/pwodzinski/repos","events_url":"https://api.github.com/users/pwodzinski/events{/privacy}","received_events_url":"https://api.github.com/users/pwodzinski/received_events","type":"User","site_admin":false},"repo":{"id":32381468,"name":"presence-analyzer-pwodzinski","full_name":"pwodzinski/presence-analyzer-pwodzinski","owner":{"login":"pwodzinski","id":11503090,"avatar_url":"https://avatars.githubusercontent.com/u/11503090?v=3","gravatar_id":"","url":"https://api.github.com/users/pwodzinski","html_url":"https://github.com/pwodzinski","followers_url":"https://api.github.com/users/pwodzinski/followers","following_url":"https://api.github.com/users/pwodzinski/following{/other_user}","gists_url":"https://api.github.com/users/pwodzinski/gists{/gist_id}","starred_url":"https://api.github.com/users/pwodzinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwodzinski/subscriptions","organizations_url":"https://api.github.com/users/pwodzinski/orgs","repos_url":"https://api.github.com/users/pwodzinski/repos","events_url":"https://api.github.com/users/pwodzinski/events{/privacy}","received_events_url":"https://api.github.com/users/pwodzinski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pwodzinski/presence-analyzer-pwodzinski","description":"","fork":true,"url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski","forks_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/forks","keys_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/teams","hooks_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/hooks","issue_events_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/issues/events{/number}","events_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/events","assignees_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/assignees{/user}","branches_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/branches{/branch}","tags_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/tags","blobs_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/git/refs{/sha}","trees_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/statuses/{sha}","languages_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/languages","stargazers_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/stargazers","contributors_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/contributors","subscribers_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/subscribers","subscription_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/subscription","commits_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/commits{/sha}","git_commits_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/git/commits{/sha}","comments_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/comments{/number}","issue_comment_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/issues/comments{/number}","contents_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/contents/{+path}","compare_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/merges","archive_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/downloads","issues_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/issues{/number}","pulls_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/pulls{/number}","milestones_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/milestones{/number}","notifications_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/labels{/name}","releases_url":"https://api.github.com/repos/pwodzinski/presence-analyzer-pwodzinski/releases{/id}","created_at":"2015-03-17T08:45:50Z","updated_at":"2015-03-17T08:45:50Z","pushed_at":"2015-03-27T13:49:36Z","git_url":"git://github.com/pwodzinski/presence-analyzer-pwodzinski.git","ssh_url":"git@github.com:pwodzinski/presence-analyzer-pwodzinski.git","clone_url":"https://github.com/pwodzinski/presence-analyzer-pwodzinski.git","svn_url":"https://github.com/pwodzinski/presence-analyzer-pwodzinski","homepage":null,"size":292,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"stxnext-kindergarten:master","ref":"master","sha":"9f40078fee8a943e0dfbff45fa67e1957f064239","user":{"login":"stxnext-kindergarten","id":5575308,"avatar_url":"https://avatars.githubusercontent.com/u/5575308?v=3","gravatar_id":"","url":"https://api.github.com/users/stxnext-kindergarten","html_url":"https://github.com/stxnext-kindergarten","followers_url":"https://api.github.com/users/stxnext-kindergarten/followers","following_url":"https://api.github.com/users/stxnext-kindergarten/following{/other_user}","gists_url":"https://api.github.com/users/stxnext-kindergarten/gists{/gist_id}","starred_url":"https://api.github.com/users/stxnext-kindergarten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stxnext-kindergarten/subscriptions","organizations_url":"https://api.github.com/users/stxnext-kindergarten/orgs","repos_url":"https://api.github.com/users/stxnext-kindergarten/repos","events_url":"https://api.github.com/users/stxnext-kindergarten/events{/privacy}","received_events_url":"https://api.github.com/users/stxnext-kindergarten/received_events","type":"Organization","site_admin":false},"repo":{"id":32313376,"name":"presence-analyzer-pwodzinski","full_name":"stxnext-kindergarten/presence-analyzer-pwodzinski","owner":{"login":"stxnext-kindergarten","id":5575308,"avatar_url":"https://avatars.githubusercontent.com/u/5575308?v=3","gravatar_id":"","url":"https://api.github.com/users/stxnext-kindergarten","html_url":"https://github.com/stxnext-kindergarten","followers_url":"https://api.github.com/users/stxnext-kindergarten/followers","following_url":"https://api.github.com/users/stxnext-kindergarten/following{/other_user}","gists_url":"https://api.github.com/users/stxnext-kindergarten/gists{/gist_id}","starred_url":"https://api.github.com/users/stxnext-kindergarten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stxnext-kindergarten/subscriptions","organizations_url":"https://api.github.com/users/stxnext-kindergarten/orgs","repos_url":"https://api.github.com/users/stxnext-kindergarten/repos","events_url":"https://api.github.com/users/stxnext-kindergarten/events{/privacy}","received_events_url":"https://api.github.com/users/stxnext-kindergarten/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stxnext-kindergarten/presence-analyzer-pwodzinski","description":"","fork":false,"url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski","forks_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/forks","keys_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/teams","hooks_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/hooks","issue_events_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/issues/events{/number}","events_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/events","assignees_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/assignees{/user}","branches_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/branches{/branch}","tags_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/tags","blobs_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/git/refs{/sha}","trees_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/statuses/{sha}","languages_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/languages","stargazers_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/stargazers","contributors_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/contributors","subscribers_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/subscribers","subscription_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/subscription","commits_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/commits{/sha}","git_commits_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/git/commits{/sha}","comments_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/comments{/number}","issue_comment_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/issues/comments{/number}","contents_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/contents/{+path}","compare_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/merges","archive_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/downloads","issues_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/issues{/number}","pulls_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls{/number}","milestones_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/milestones{/number}","notifications_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/labels{/name}","releases_url":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/releases{/id}","created_at":"2015-03-16T09:12:58Z","updated_at":"2015-03-25T13:26:13Z","pushed_at":"2015-03-27T13:49:36Z","git_url":"git://github.com/stxnext-kindergarten/presence-analyzer-pwodzinski.git","ssh_url":"git@github.com:stxnext-kindergarten/presence-analyzer-pwodzinski.git","clone_url":"https://github.com/stxnext-kindergarten/presence-analyzer-pwodzinski.git","svn_url":"https://github.com/stxnext-kindergarten/presence-analyzer-pwodzinski","homepage":null,"size":375,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/4"},"html":{"href":"https://github.com/stxnext-kindergarten/presence-analyzer-pwodzinski/pull/4"},"issue":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/issues/4"},"comments":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/stxnext-kindergarten/presence-analyzer-pwodzinski/statuses/784ccba8d0f751865327141d9097ae1c0662b531"}}}}