{"action":"created","comment":{"url":"https://api.github.com/repos/YunoHost/moulinette/pulls/comments/237541393","pull_request_review_id":179864885,"id":237541393,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzU0MTM5Mw==","diff_hunk":"@@ -233,14 +233,33 @@ def validate_uniqueness(self, value_dict):\n         Returns:\n             Boolean | MoulinetteError\n \n+        \"\"\"\n+        attr_found = self.get_conflict(value_dict)\n+        if attr_found:\n+            logger.info(\"attribute '%s' with value '%s' is not unique\",\n+                        attr_found[0], attr_found[1])\n+            raise MoulinetteError(errno.EEXIST,\n+                                  m18n.g('ldap_attribute_already_exists',\n+                                         attribute=attr_found[0],\n+                                         value=attr_found[1]))\n+        return True\n+\n+    def get_conflict(self, value_dict, base_dn=None):","path":"moulinette/authenticators/ldap.py","position":15,"original_position":15,"commit_id":"b64e2d768c6e1a7be76dce5de633c1d236ad70e5","original_commit_id":"b64e2d768c6e1a7be76dce5de633c1d236ad70e5","user":{"login":"Josue-T","id":7387681,"node_id":"MDQ6VXNlcjczODc2ODE=","avatar_url":"https://avatars1.githubusercontent.com/u/7387681?v=4","gravatar_id":"","url":"https://api.github.com/users/Josue-T","html_url":"https://github.com/Josue-T","followers_url":"https://api.github.com/users/Josue-T/followers","following_url":"https://api.github.com/users/Josue-T/following{/other_user}","gists_url":"https://api.github.com/users/Josue-T/gists{/gist_id}","starred_url":"https://api.github.com/users/Josue-T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Josue-T/subscriptions","organizations_url":"https://api.github.com/users/Josue-T/orgs","repos_url":"https://api.github.com/users/Josue-T/repos","events_url":"https://api.github.com/users/Josue-T/events{/privacy}","received_events_url":"https://api.github.com/users/Josue-T/received_events","type":"User","site_admin":false},"body":"Because sometime I don't want all element in all part in the LDAP tree. By example want only to now in the group subtree  if there are a conflict.","created_at":"2018-11-29T15:46:44Z","updated_at":"2018-11-29T15:46:44Z","html_url":"https://github.com/YunoHost/moulinette/pull/181#discussion_r237541393","pull_request_url":"https://api.github.com/repos/YunoHost/moulinette/pulls/181","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/YunoHost/moulinette/pulls/comments/237541393"},"html":{"href":"https://github.com/YunoHost/moulinette/pull/181#discussion_r237541393"},"pull_request":{"href":"https://api.github.com/repos/YunoHost/moulinette/pulls/181"}},"in_reply_to_id":237524814},"pull_request":{"url":"https://api.github.com/repos/YunoHost/moulinette/pulls/181","id":233471934,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNDcxOTM0","html_url":"https://github.com/YunoHost/moulinette/pull/181","diff_url":"https://github.com/YunoHost/moulinette/pull/181.diff","patch_url":"https://github.com/YunoHost/moulinette/pull/181.patch","issue_url":"https://api.github.com/repos/YunoHost/moulinette/issues/181","number":181,"state":"open","locked":false,"title":"Add possiblity to get attribute name of conflict in LDAP","user":{"login":"Josue-T","id":7387681,"node_id":"MDQ6VXNlcjczODc2ODE=","avatar_url":"https://avatars1.githubusercontent.com/u/7387681?v=4","gravatar_id":"","url":"https://api.github.com/users/Josue-T","html_url":"https://github.com/Josue-T","followers_url":"https://api.github.com/users/Josue-T/followers","following_url":"https://api.github.com/users/Josue-T/following{/other_user}","gists_url":"https://api.github.com/users/Josue-T/gists{/gist_id}","starred_url":"https://api.github.com/users/Josue-T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Josue-T/subscriptions","organizations_url":"https://api.github.com/users/Josue-T/orgs","repos_url":"https://api.github.com/users/Josue-T/repos","events_url":"https://api.github.com/users/Josue-T/events{/privacy}","received_events_url":"https://api.github.com/users/Josue-T/received_events","type":"User","site_admin":false},"body":"# Problem\r\n\r\n- When we call the function `validate_uniqueness` we can't know if there are a conflict we don't know which attribute have generate a conflict and with which object we have a conflict.\r\n- We can't manage the error with the function which call `validate_uniqueness`. Result is that if there are a conflict the user just see a message \"Attribute '{attribute}' already exists with value '{value}'\" but the user might not know the meaning of the attribute name.\r\n\r\n# Solution\r\n\r\n- Create a function `get_conflict` which just return the name of the attribute and it value if there are a conflict.\r\n","created_at":"2018-11-26T08:23:23Z","updated_at":"2018-11-29T15:46:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b2638c21311e06f3223c563a81ba1024402d230","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Psycojoker","id":41827,"node_id":"MDQ6VXNlcjQxODI3","avatar_url":"https://avatars0.githubusercontent.com/u/41827?v=4","gravatar_id":"","url":"https://api.github.com/users/Psycojoker","html_url":"https://github.com/Psycojoker","followers_url":"https://api.github.com/users/Psycojoker/followers","following_url":"https://api.github.com/users/Psycojoker/following{/other_user}","gists_url":"https://api.github.com/users/Psycojoker/gists{/gist_id}","starred_url":"https://api.github.com/users/Psycojoker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Psycojoker/subscriptions","organizations_url":"https://api.github.com/users/Psycojoker/orgs","repos_url":"https://api.github.com/users/Psycojoker/repos","events_url":"https://api.github.com/users/Psycojoker/events{/privacy}","received_events_url":"https://api.github.com/users/Psycojoker/received_events","type":"User","site_admin":false},{"login":"JimboJoe","id":423472,"node_id":"MDQ6VXNlcjQyMzQ3Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/423472?v=4","gravatar_id":"","url":"https://api.github.com/users/JimboJoe","html_url":"https://github.com/JimboJoe","followers_url":"https://api.github.com/users/JimboJoe/followers","following_url":"https://api.github.com/users/JimboJoe/following{/other_user}","gists_url":"https://api.github.com/users/JimboJoe/gists{/gist_id}","starred_url":"https://api.github.com/users/JimboJoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JimboJoe/subscriptions","organizations_url":"https://api.github.com/users/JimboJoe/orgs","repos_url":"https://api.github.com/users/JimboJoe/repos","events_url":"https://api.github.com/users/JimboJoe/events{/privacy}","received_events_url":"https://api.github.com/users/JimboJoe/received_events","type":"User","site_admin":false},{"login":"zamentur","id":4080016,"node_id":"MDQ6VXNlcjQwODAwMTY=","avatar_url":"https://avatars0.githubusercontent.com/u/4080016?v=4","gravatar_id":"","url":"https://api.github.com/users/zamentur","html_url":"https://github.com/zamentur","followers_url":"https://api.github.com/users/zamentur/followers","following_url":"https://api.github.com/users/zamentur/following{/other_user}","gists_url":"https://api.github.com/users/zamentur/gists{/gist_id}","starred_url":"https://api.github.com/users/zamentur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zamentur/subscriptions","organizations_url":"https://api.github.com/users/zamentur/orgs","repos_url":"https://api.github.com/users/zamentur/repos","events_url":"https://api.github.com/users/zamentur/events{/privacy}","received_events_url":"https://api.github.com/users/zamentur/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/YunoHost/moulinette/pulls/181/commits","review_comments_url":"https://api.github.com/repos/YunoHost/moulinette/pulls/181/comments","review_comment_url":"https://api.github.com/repos/YunoHost/moulinette/pulls/comments{/number}","comments_url":"https://api.github.com/repos/YunoHost/moulinette/issues/181/comments","statuses_url":"https://api.github.com/repos/YunoHost/moulinette/statuses/b64e2d768c6e1a7be76dce5de633c1d236ad70e5","head":{"label":"YunoHost:LDAP_validate_uniqueness","ref":"LDAP_validate_uniqueness","sha":"b64e2d768c6e1a7be76dce5de633c1d236ad70e5","user":{"login":"YunoHost","id":1519495,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTk0OTU=","avatar_url":"https://avatars0.githubusercontent.com/u/1519495?v=4","gravatar_id":"","url":"https://api.github.com/users/YunoHost","html_url":"https://github.com/YunoHost","followers_url":"https://api.github.com/users/YunoHost/followers","following_url":"https://api.github.com/users/YunoHost/following{/other_user}","gists_url":"https://api.github.com/users/YunoHost/gists{/gist_id}","starred_url":"https://api.github.com/users/YunoHost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YunoHost/subscriptions","organizations_url":"https://api.github.com/users/YunoHost/orgs","repos_url":"https://api.github.com/users/YunoHost/repos","events_url":"https://api.github.com/users/YunoHost/events{/privacy}","received_events_url":"https://api.github.com/users/YunoHost/received_events","type":"Organization","site_admin":false},"repo":{"id":6103387,"node_id":"MDEwOlJlcG9zaXRvcnk2MTAzMzg3","name":"moulinette","full_name":"YunoHost/moulinette","private":false,"owner":{"login":"YunoHost","id":1519495,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTk0OTU=","avatar_url":"https://avatars0.githubusercontent.com/u/1519495?v=4","gravatar_id":"","url":"https://api.github.com/users/YunoHost","html_url":"https://github.com/YunoHost","followers_url":"https://api.github.com/users/YunoHost/followers","following_url":"https://api.github.com/users/YunoHost/following{/other_user}","gists_url":"https://api.github.com/users/YunoHost/gists{/gist_id}","starred_url":"https://api.github.com/users/YunoHost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YunoHost/subscriptions","organizations_url":"https://api.github.com/users/YunoHost/orgs","repos_url":"https://api.github.com/users/YunoHost/repos","events_url":"https://api.github.com/users/YunoHost/events{/privacy}","received_events_url":"https://api.github.com/users/YunoHost/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/YunoHost/moulinette","description":"Prototype interfaces with ease in Python","fork":false,"url":"https://api.github.com/repos/YunoHost/moulinette","forks_url":"https://api.github.com/repos/YunoHost/moulinette/forks","keys_url":"https://api.github.com/repos/YunoHost/moulinette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YunoHost/moulinette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YunoHost/moulinette/teams","hooks_url":"https://api.github.com/repos/YunoHost/moulinette/hooks","issue_events_url":"https://api.github.com/repos/YunoHost/moulinette/issues/events{/number}","events_url":"https://api.github.com/repos/YunoHost/moulinette/events","assignees_url":"https://api.github.com/repos/YunoHost/moulinette/assignees{/user}","branches_url":"https://api.github.com/repos/YunoHost/moulinette/branches{/branch}","tags_url":"https://api.github.com/repos/YunoHost/moulinette/tags","blobs_url":"https://api.github.com/repos/YunoHost/moulinette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YunoHost/moulinette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YunoHost/moulinette/git/refs{/sha}","trees_url":"https://api.github.com/repos/YunoHost/moulinette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YunoHost/moulinette/statuses/{sha}","languages_url":"https://api.github.com/repos/YunoHost/moulinette/languages","stargazers_url":"https://api.github.com/repos/YunoHost/moulinette/stargazers","contributors_url":"https://api.github.com/repos/YunoHost/moulinette/contributors","subscribers_url":"https://api.github.com/repos/YunoHost/moulinette/subscribers","subscription_url":"https://api.github.com/repos/YunoHost/moulinette/subscription","commits_url":"https://api.github.com/repos/YunoHost/moulinette/commits{/sha}","git_commits_url":"https://api.github.com/repos/YunoHost/moulinette/git/commits{/sha}","comments_url":"https://api.github.com/repos/YunoHost/moulinette/comments{/number}","issue_comment_url":"https://api.github.com/repos/YunoHost/moulinette/issues/comments{/number}","contents_url":"https://api.github.com/repos/YunoHost/moulinette/contents/{+path}","compare_url":"https://api.github.com/repos/YunoHost/moulinette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YunoHost/moulinette/merges","archive_url":"https://api.github.com/repos/YunoHost/moulinette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YunoHost/moulinette/downloads","issues_url":"https://api.github.com/repos/YunoHost/moulinette/issues{/number}","pulls_url":"https://api.github.com/repos/YunoHost/moulinette/pulls{/number}","milestones_url":"https://api.github.com/repos/YunoHost/moulinette/milestones{/number}","notifications_url":"https://api.github.com/repos/YunoHost/moulinette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YunoHost/moulinette/labels{/name}","releases_url":"https://api.github.com/repos/YunoHost/moulinette/releases{/id}","deployments_url":"https://api.github.com/repos/YunoHost/moulinette/deployments","created_at":"2012-10-06T14:19:29Z","updated_at":"2018-11-23T14:05:14Z","pushed_at":"2018-11-26T15:56:45Z","git_url":"git://github.com/YunoHost/moulinette.git","ssh_url":"git@github.com:YunoHost/moulinette.git","clone_url":"https://github.com/YunoHost/moulinette.git","svn_url":"https://github.com/YunoHost/moulinette","homepage":"http://yunohost.org","size":2542,"stargazers_count":17,"watchers_count":17,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":18,"open_issues":24,"watchers":17,"default_branch":"stretch-unstable"}},"base":{"label":"YunoHost:stretch-unstable","ref":"stretch-unstable","sha":"9720bd1a7cd5eabadbcbbbbdbdef82bf77471542","user":{"login":"YunoHost","id":1519495,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTk0OTU=","avatar_url":"https://avatars0.githubusercontent.com/u/1519495?v=4","gravatar_id":"","url":"https://api.github.com/users/YunoHost","html_url":"https://github.com/YunoHost","followers_url":"https://api.github.com/users/YunoHost/followers","following_url":"https://api.github.com/users/YunoHost/following{/other_user}","gists_url":"https://api.github.com/users/YunoHost/gists{/gist_id}","starred_url":"https://api.github.com/users/YunoHost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YunoHost/subscriptions","organizations_url":"https://api.github.com/users/YunoHost/orgs","repos_url":"https://api.github.com/users/YunoHost/repos","events_url":"https://api.github.com/users/YunoHost/events{/privacy}","received_events_url":"https://api.github.com/users/YunoHost/received_events","type":"Organization","site_admin":false},"repo":{"id":6103387,"node_id":"MDEwOlJlcG9zaXRvcnk2MTAzMzg3","name":"moulinette","full_name":"YunoHost/moulinette","private":false,"owner":{"login":"YunoHost","id":1519495,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MTk0OTU=","avatar_url":"https://avatars0.githubusercontent.com/u/1519495?v=4","gravatar_id":"","url":"https://api.github.com/users/YunoHost","html_url":"https://github.com/YunoHost","followers_url":"https://api.github.com/users/YunoHost/followers","following_url":"https://api.github.com/users/YunoHost/following{/other_user}","gists_url":"https://api.github.com/users/YunoHost/gists{/gist_id}","starred_url":"https://api.github.com/users/YunoHost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YunoHost/subscriptions","organizations_url":"https://api.github.com/users/YunoHost/orgs","repos_url":"https://api.github.com/users/YunoHost/repos","events_url":"https://api.github.com/users/YunoHost/events{/privacy}","received_events_url":"https://api.github.com/users/YunoHost/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/YunoHost/moulinette","description":"Prototype interfaces with ease in Python","fork":false,"url":"https://api.github.com/repos/YunoHost/moulinette","forks_url":"https://api.github.com/repos/YunoHost/moulinette/forks","keys_url":"https://api.github.com/repos/YunoHost/moulinette/keys{/key_id}","collaborators_url":"https://api.github.com/repos/YunoHost/moulinette/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/YunoHost/moulinette/teams","hooks_url":"https://api.github.com/repos/YunoHost/moulinette/hooks","issue_events_url":"https://api.github.com/repos/YunoHost/moulinette/issues/events{/number}","events_url":"https://api.github.com/repos/YunoHost/moulinette/events","assignees_url":"https://api.github.com/repos/YunoHost/moulinette/assignees{/user}","branches_url":"https://api.github.com/repos/YunoHost/moulinette/branches{/branch}","tags_url":"https://api.github.com/repos/YunoHost/moulinette/tags","blobs_url":"https://api.github.com/repos/YunoHost/moulinette/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/YunoHost/moulinette/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/YunoHost/moulinette/git/refs{/sha}","trees_url":"https://api.github.com/repos/YunoHost/moulinette/git/trees{/sha}","statuses_url":"https://api.github.com/repos/YunoHost/moulinette/statuses/{sha}","languages_url":"https://api.github.com/repos/YunoHost/moulinette/languages","stargazers_url":"https://api.github.com/repos/YunoHost/moulinette/stargazers","contributors_url":"https://api.github.com/repos/YunoHost/moulinette/contributors","subscribers_url":"https://api.github.com/repos/YunoHost/moulinette/subscribers","subscription_url":"https://api.github.com/repos/YunoHost/moulinette/subscription","commits_url":"https://api.github.com/repos/YunoHost/moulinette/commits{/sha}","git_commits_url":"https://api.github.com/repos/YunoHost/moulinette/git/commits{/sha}","comments_url":"https://api.github.com/repos/YunoHost/moulinette/comments{/number}","issue_comment_url":"https://api.github.com/repos/YunoHost/moulinette/issues/comments{/number}","contents_url":"https://api.github.com/repos/YunoHost/moulinette/contents/{+path}","compare_url":"https://api.github.com/repos/YunoHost/moulinette/compare/{base}...{head}","merges_url":"https://api.github.com/repos/YunoHost/moulinette/merges","archive_url":"https://api.github.com/repos/YunoHost/moulinette/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/YunoHost/moulinette/downloads","issues_url":"https://api.github.com/repos/YunoHost/moulinette/issues{/number}","pulls_url":"https://api.github.com/repos/YunoHost/moulinette/pulls{/number}","milestones_url":"https://api.github.com/repos/YunoHost/moulinette/milestones{/number}","notifications_url":"https://api.github.com/repos/YunoHost/moulinette/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/YunoHost/moulinette/labels{/name}","releases_url":"https://api.github.com/repos/YunoHost/moulinette/releases{/id}","deployments_url":"https://api.github.com/repos/YunoHost/moulinette/deployments","created_at":"2012-10-06T14:19:29Z","updated_at":"2018-11-23T14:05:14Z","pushed_at":"2018-11-26T15:56:45Z","git_url":"git://github.com/YunoHost/moulinette.git","ssh_url":"git@github.com:YunoHost/moulinette.git","clone_url":"https://github.com/YunoHost/moulinette.git","svn_url":"https://github.com/YunoHost/moulinette","homepage":"http://yunohost.org","size":2542,"stargazers_count":17,"watchers_count":17,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":24,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":18,"open_issues":24,"watchers":17,"default_branch":"stretch-unstable"}},"_links":{"self":{"href":"https://api.github.com/repos/YunoHost/moulinette/pulls/181"},"html":{"href":"https://github.com/YunoHost/moulinette/pull/181"},"issue":{"href":"https://api.github.com/repos/YunoHost/moulinette/issues/181"},"comments":{"href":"https://api.github.com/repos/YunoHost/moulinette/issues/181/comments"},"review_comments":{"href":"https://api.github.com/repos/YunoHost/moulinette/pulls/181/comments"},"review_comment":{"href":"https://api.github.com/repos/YunoHost/moulinette/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/YunoHost/moulinette/pulls/181/commits"},"statuses":{"href":"https://api.github.com/repos/YunoHost/moulinette/statuses/b64e2d768c6e1a7be76dce5de633c1d236ad70e5"}},"author_association":"NONE"}}
{"actor":{"display_login":"Josue-T"}}