{"action":"closed","number":1568,"pull_request":{"url":"https://api.github.com/repos/pallets/flask/pulls/1568","id":44889462,"html_url":"https://github.com/pallets/flask/pull/1568","diff_url":"https://github.com/pallets/flask/pull/1568.diff","patch_url":"https://github.com/pallets/flask/pull/1568.patch","issue_url":"https://api.github.com/repos/pallets/flask/issues/1568","number":1568,"state":"closed","locked":false,"title":"Url conflict assert","user":{"login":"rawrgulmuffins","id":1521575,"avatar_url":"https://avatars3.githubusercontent.com/u/1521575?v=3","gravatar_id":"","url":"https://api.github.com/users/rawrgulmuffins","html_url":"https://github.com/rawrgulmuffins","followers_url":"https://api.github.com/users/rawrgulmuffins/followers","following_url":"https://api.github.com/users/rawrgulmuffins/following{/other_user}","gists_url":"https://api.github.com/users/rawrgulmuffins/gists{/gist_id}","starred_url":"https://api.github.com/users/rawrgulmuffins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawrgulmuffins/subscriptions","organizations_url":"https://api.github.com/users/rawrgulmuffins/orgs","repos_url":"https://api.github.com/users/rawrgulmuffins/repos","events_url":"https://api.github.com/users/rawrgulmuffins/events{/privacy}","received_events_url":"https://api.github.com/users/rawrgulmuffins/received_events","type":"User","site_admin":false},"body":"This PR is an attempt to reconcile the fact that you can't have two routes with the same function name but you can create two routes with the same URL.\n\n```\nfrom flask import Flask\napp = Flask(\"the_flask_module\")\n\n@app.route(\"/hello\")\ndef hello_page():\n    return \"I'm a hello page\"\n\n@app.route(\"/different_route\")\ndef hello_page():\n    return \"Different route\"\n```\n\nwill throw an `AssertionError`\n\nbut \n\n```\n@app.route(\"/hello\")\ndef end_point1():\n    return \"I'm a hello page\"\n\n@app.route(\"/hello\")\ndef end_point2():\n    return \"Different route\"\n```\n\nwont. In fact the second route is unreachable. \n\nThis PR checks to see if three conditions are true before raising an assertion. The new rule has to have a `subdomain`, `url_path`, and one `method` that overlap with a current rule in the `self.url_map object`.\n\nThere's a couple of wonky pieces in this pull request that were required to get all of the unit tests to pass.\n\n```\nif prior_rule.rule == \"/static/<path:filename>\":\n    continue\n```\n\nwas required to get blueprints to not throw an assertion since each blueprint registers a `\"/static/<path:filename>\"` rule for each blueprint. I tried to find a way to not have to use a static string but alas I failed. \n\nSecondly \n\n```\n methods_minus_required = ((rule.methods & prior_rule.methods) \n     - required_methods)\n```\n\nis used to check for all explicitly registered methods for a route since there were a bunch of cases where the `OPTIONS` method was implicitly added to rules that shared a url_path.\n\n<!-- Reviewable:start -->\n\n---\n\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/pallets/flask/1568)\n\n<!-- Reviewable:end -->\n","created_at":"2015-09-14T03:10:59Z","updated_at":"2017-04-25T11:21:23Z","closed_at":"2017-04-25T11:21:23Z","merged_at":null,"merge_commit_sha":"211a2360b6dbdb772e259224fdbc473d4b2ef293","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pallets/flask/pulls/1568/commits","review_comments_url":"https://api.github.com/repos/pallets/flask/pulls/1568/comments","review_comment_url":"https://api.github.com/repos/pallets/flask/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pallets/flask/issues/1568/comments","statuses_url":"https://api.github.com/repos/pallets/flask/statuses/34f4b1b4d0caa3a31e2ce85e9d85fd30770d6788","head":{"label":"rawrgulmuffins:url_conflict_assert","ref":"url_conflict_assert","sha":"34f4b1b4d0caa3a31e2ce85e9d85fd30770d6788","user":{"login":"rawrgulmuffins","id":1521575,"avatar_url":"https://avatars3.githubusercontent.com/u/1521575?v=3","gravatar_id":"","url":"https://api.github.com/users/rawrgulmuffins","html_url":"https://github.com/rawrgulmuffins","followers_url":"https://api.github.com/users/rawrgulmuffins/followers","following_url":"https://api.github.com/users/rawrgulmuffins/following{/other_user}","gists_url":"https://api.github.com/users/rawrgulmuffins/gists{/gist_id}","starred_url":"https://api.github.com/users/rawrgulmuffins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawrgulmuffins/subscriptions","organizations_url":"https://api.github.com/users/rawrgulmuffins/orgs","repos_url":"https://api.github.com/users/rawrgulmuffins/repos","events_url":"https://api.github.com/users/rawrgulmuffins/events{/privacy}","received_events_url":"https://api.github.com/users/rawrgulmuffins/received_events","type":"User","site_admin":false},"repo":{"id":36961293,"name":"flask","full_name":"rawrgulmuffins/flask","owner":{"login":"rawrgulmuffins","id":1521575,"avatar_url":"https://avatars3.githubusercontent.com/u/1521575?v=3","gravatar_id":"","url":"https://api.github.com/users/rawrgulmuffins","html_url":"https://github.com/rawrgulmuffins","followers_url":"https://api.github.com/users/rawrgulmuffins/followers","following_url":"https://api.github.com/users/rawrgulmuffins/following{/other_user}","gists_url":"https://api.github.com/users/rawrgulmuffins/gists{/gist_id}","starred_url":"https://api.github.com/users/rawrgulmuffins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rawrgulmuffins/subscriptions","organizations_url":"https://api.github.com/users/rawrgulmuffins/orgs","repos_url":"https://api.github.com/users/rawrgulmuffins/repos","events_url":"https://api.github.com/users/rawrgulmuffins/events{/privacy}","received_events_url":"https://api.github.com/users/rawrgulmuffins/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rawrgulmuffins/flask","description":"A microframework based on Werkzeug, Jinja2 and good intentions","fork":true,"url":"https://api.github.com/repos/rawrgulmuffins/flask","forks_url":"https://api.github.com/repos/rawrgulmuffins/flask/forks","keys_url":"https://api.github.com/repos/rawrgulmuffins/flask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rawrgulmuffins/flask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rawrgulmuffins/flask/teams","hooks_url":"https://api.github.com/repos/rawrgulmuffins/flask/hooks","issue_events_url":"https://api.github.com/repos/rawrgulmuffins/flask/issues/events{/number}","events_url":"https://api.github.com/repos/rawrgulmuffins/flask/events","assignees_url":"https://api.github.com/repos/rawrgulmuffins/flask/assignees{/user}","branches_url":"https://api.github.com/repos/rawrgulmuffins/flask/branches{/branch}","tags_url":"https://api.github.com/repos/rawrgulmuffins/flask/tags","blobs_url":"https://api.github.com/repos/rawrgulmuffins/flask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rawrgulmuffins/flask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rawrgulmuffins/flask/git/refs{/sha}","trees_url":"https://api.github.com/repos/rawrgulmuffins/flask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rawrgulmuffins/flask/statuses/{sha}","languages_url":"https://api.github.com/repos/rawrgulmuffins/flask/languages","stargazers_url":"https://api.github.com/repos/rawrgulmuffins/flask/stargazers","contributors_url":"https://api.github.com/repos/rawrgulmuffins/flask/contributors","subscribers_url":"https://api.github.com/repos/rawrgulmuffins/flask/subscribers","subscription_url":"https://api.github.com/repos/rawrgulmuffins/flask/subscription","commits_url":"https://api.github.com/repos/rawrgulmuffins/flask/commits{/sha}","git_commits_url":"https://api.github.com/repos/rawrgulmuffins/flask/git/commits{/sha}","comments_url":"https://api.github.com/repos/rawrgulmuffins/flask/comments{/number}","issue_comment_url":"https://api.github.com/repos/rawrgulmuffins/flask/issues/comments{/number}","contents_url":"https://api.github.com/repos/rawrgulmuffins/flask/contents/{+path}","compare_url":"https://api.github.com/repos/rawrgulmuffins/flask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rawrgulmuffins/flask/merges","archive_url":"https://api.github.com/repos/rawrgulmuffins/flask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rawrgulmuffins/flask/downloads","issues_url":"https://api.github.com/repos/rawrgulmuffins/flask/issues{/number}","pulls_url":"https://api.github.com/repos/rawrgulmuffins/flask/pulls{/number}","milestones_url":"https://api.github.com/repos/rawrgulmuffins/flask/milestones{/number}","notifications_url":"https://api.github.com/repos/rawrgulmuffins/flask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rawrgulmuffins/flask/labels{/name}","releases_url":"https://api.github.com/repos/rawrgulmuffins/flask/releases{/id}","deployments_url":"https://api.github.com/repos/rawrgulmuffins/flask/deployments","created_at":"2015-06-06T00:11:19Z","updated_at":"2016-03-30T13:49:58Z","pushed_at":"2016-05-30T17:38:24Z","git_url":"git://github.com/rawrgulmuffins/flask.git","ssh_url":"git@github.com:rawrgulmuffins/flask.git","clone_url":"https://github.com/rawrgulmuffins/flask.git","svn_url":"https://github.com/rawrgulmuffins/flask","homepage":"http://flask.pocoo.org/","size":3950,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"pallets:master","ref":"master","sha":"4f83f705e7a5f35381841148caf04b2829873faf","user":{"login":"pallets","id":16748505,"avatar_url":"https://avatars0.githubusercontent.com/u/16748505?v=3","gravatar_id":"","url":"https://api.github.com/users/pallets","html_url":"https://github.com/pallets","followers_url":"https://api.github.com/users/pallets/followers","following_url":"https://api.github.com/users/pallets/following{/other_user}","gists_url":"https://api.github.com/users/pallets/gists{/gist_id}","starred_url":"https://api.github.com/users/pallets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pallets/subscriptions","organizations_url":"https://api.github.com/users/pallets/orgs","repos_url":"https://api.github.com/users/pallets/repos","events_url":"https://api.github.com/users/pallets/events{/privacy}","received_events_url":"https://api.github.com/users/pallets/received_events","type":"Organization","site_admin":false},"repo":{"id":596892,"name":"flask","full_name":"pallets/flask","owner":{"login":"pallets","id":16748505,"avatar_url":"https://avatars0.githubusercontent.com/u/16748505?v=3","gravatar_id":"","url":"https://api.github.com/users/pallets","html_url":"https://github.com/pallets","followers_url":"https://api.github.com/users/pallets/followers","following_url":"https://api.github.com/users/pallets/following{/other_user}","gists_url":"https://api.github.com/users/pallets/gists{/gist_id}","starred_url":"https://api.github.com/users/pallets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pallets/subscriptions","organizations_url":"https://api.github.com/users/pallets/orgs","repos_url":"https://api.github.com/users/pallets/repos","events_url":"https://api.github.com/users/pallets/events{/privacy}","received_events_url":"https://api.github.com/users/pallets/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pallets/flask","description":"A microframework based on Werkzeug, Jinja2 and good intentions","fork":false,"url":"https://api.github.com/repos/pallets/flask","forks_url":"https://api.github.com/repos/pallets/flask/forks","keys_url":"https://api.github.com/repos/pallets/flask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pallets/flask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pallets/flask/teams","hooks_url":"https://api.github.com/repos/pallets/flask/hooks","issue_events_url":"https://api.github.com/repos/pallets/flask/issues/events{/number}","events_url":"https://api.github.com/repos/pallets/flask/events","assignees_url":"https://api.github.com/repos/pallets/flask/assignees{/user}","branches_url":"https://api.github.com/repos/pallets/flask/branches{/branch}","tags_url":"https://api.github.com/repos/pallets/flask/tags","blobs_url":"https://api.github.com/repos/pallets/flask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pallets/flask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pallets/flask/git/refs{/sha}","trees_url":"https://api.github.com/repos/pallets/flask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pallets/flask/statuses/{sha}","languages_url":"https://api.github.com/repos/pallets/flask/languages","stargazers_url":"https://api.github.com/repos/pallets/flask/stargazers","contributors_url":"https://api.github.com/repos/pallets/flask/contributors","subscribers_url":"https://api.github.com/repos/pallets/flask/subscribers","subscription_url":"https://api.github.com/repos/pallets/flask/subscription","commits_url":"https://api.github.com/repos/pallets/flask/commits{/sha}","git_commits_url":"https://api.github.com/repos/pallets/flask/git/commits{/sha}","comments_url":"https://api.github.com/repos/pallets/flask/comments{/number}","issue_comment_url":"https://api.github.com/repos/pallets/flask/issues/comments{/number}","contents_url":"https://api.github.com/repos/pallets/flask/contents/{+path}","compare_url":"https://api.github.com/repos/pallets/flask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pallets/flask/merges","archive_url":"https://api.github.com/repos/pallets/flask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pallets/flask/downloads","issues_url":"https://api.github.com/repos/pallets/flask/issues{/number}","pulls_url":"https://api.github.com/repos/pallets/flask/pulls{/number}","milestones_url":"https://api.github.com/repos/pallets/flask/milestones{/number}","notifications_url":"https://api.github.com/repos/pallets/flask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pallets/flask/labels{/name}","releases_url":"https://api.github.com/repos/pallets/flask/releases{/id}","deployments_url":"https://api.github.com/repos/pallets/flask/deployments","created_at":"2010-04-06T11:11:59Z","updated_at":"2017-04-25T10:37:00Z","pushed_at":"2017-04-24T17:17:05Z","git_url":"git://github.com/pallets/flask.git","ssh_url":"git@github.com:pallets/flask.git","clone_url":"https://github.com/pallets/flask.git","svn_url":"https://github.com/pallets/flask","homepage":"http://flask.pocoo.org/","size":4185,"stargazers_count":26636,"watchers_count":26636,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8438,"mirror_url":null,"open_issues_count":136,"forks":8438,"open_issues":136,"watchers":26636,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pallets/flask/pulls/1568"},"html":{"href":"https://github.com/pallets/flask/pull/1568"},"issue":{"href":"https://api.github.com/repos/pallets/flask/issues/1568"},"comments":{"href":"https://api.github.com/repos/pallets/flask/issues/1568/comments"},"review_comments":{"href":"https://api.github.com/repos/pallets/flask/pulls/1568/comments"},"review_comment":{"href":"https://api.github.com/repos/pallets/flask/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pallets/flask/pulls/1568/commits"},"statuses":{"href":"https://api.github.com/repos/pallets/flask/statuses/34f4b1b4d0caa3a31e2ce85e9d85fd30770d6788"}},"merged":false,"mergeable":false,"rebaseable":false,"mergeable_state":"dirty","merged_by":null,"comments":7,"review_comments":6,"maintainer_can_modify":false,"commits":1,"additions":88,"deletions":8,"changed_files":2}}
{"actor":{"display_login":"untitaker"}}