{"action":"closed","number":1056,"pull_request":{"url":"https://api.github.com/repos/privacyidea/privacyidea/pulls/1056","id":186674168,"html_url":"https://github.com/privacyidea/privacyidea/pull/1056","diff_url":"https://github.com/privacyidea/privacyidea/pull/1056.diff","patch_url":"https://github.com/privacyidea/privacyidea/pull/1056.patch","issue_url":"https://api.github.com/repos/privacyidea/privacyidea/issues/1056","number":1056,"state":"closed","locked":false,"title":"Improve counter event handler","user":{"login":"plettich","id":37443810,"avatar_url":"https://avatars0.githubusercontent.com/u/37443810?v=4","gravatar_id":"","url":"https://api.github.com/users/plettich","html_url":"https://github.com/plettich","followers_url":"https://api.github.com/users/plettich/followers","following_url":"https://api.github.com/users/plettich/following{/other_user}","gists_url":"https://api.github.com/users/plettich/gists{/gist_id}","starred_url":"https://api.github.com/users/plettich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plettich/subscriptions","organizations_url":"https://api.github.com/users/plettich/orgs","repos_url":"https://api.github.com/users/plettich/repos","events_url":"https://api.github.com/users/plettich/events{/privacy}","received_events_url":"https://api.github.com/users/plettich/received_events","type":"User","site_admin":false},"body":"Add a decrease_counter and reset_counter action to the counter event handler.\r\nUpdated corresponding test cases.\r\nFixes #991\n<a href='#crh-start'></a><a href='#crh-data-%7B%22processed%22%3A%20%5B%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23issuecomment-387458964%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186831816%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186832639%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186834160%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186834422%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186835504%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186962097%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186977221%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r187555340%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r187555344%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r187555479%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r187555483%22%2C%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r187555782%22%5D%2C%20%22comments%22%3A%20%7B%22General%20Comment%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23issuecomment-387458964%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22%23%20%5BCodecov%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056%3Fsrc%3Dpr%26el%3Dh1%29%20Report%5Cn%3E%20Merging%20%5B%231056%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056%3Fsrc%3Dpr%26el%3Ddesc%29%20into%20%5Bmaster%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/commit/519b0d1730d17c6b69a8b8b3c9379d576f7d3f7b%3Fsrc%3Dpr%26el%3Ddesc%29%20will%20%2A%2Adecrease%2A%2A%20coverage%20by%20%60%3C.01%25%60.%5Cn%3E%20The%20diff%20coverage%20is%20%6060%25%60.%5Cn%5Cn%5B%21%5BImpacted%20file%20tree%20graph%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056/graphs/tree.svg%3Ftoken%3D7nHLZki60B%26width%3D650%26height%3D150%26src%3Dpr%29%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056%3Fsrc%3Dpr%26el%3Dtree%29%5Cn%5Cn%60%60%60diff%5Cn%40%40%20%20%20%20%20%20%20%20%20%20%20%20Coverage%20Diff%20%20%20%20%20%20%20%20%20%20%20%20%20%40%40%5Cn%23%23%20%20%20%20%20%20%20%20%20%20%20master%20%20%20%20%231056%20%20%20%20%20%20%2B/-%20%20%20%23%23%5Cn%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%5Cn-%20Coverage%20%20%2095.41%25%20%20%2095.41%25%20%20%20-0.01%25%20%20%20%20%20%5Cn%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%5Cn%20%20Files%20%20%20%20%20%20%20%20%20131%20%20%20%20%20%20131%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Cn%20%20Lines%20%20%20%20%20%20%2016211%20%20%20%2016382%20%20%20%20%20%2B171%20%20%20%20%20%5Cn%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%5Cn%2B%20Hits%20%20%20%20%20%20%20%2015468%20%20%20%2015631%20%20%20%20%20%2B163%20%20%20%20%20%5Cn-%20Misses%20%20%20%20%20%20%20%20743%20%20%20%20%20%20751%20%20%20%20%20%20%20%2B8%5Cn%60%60%60%5Cn%5Cn%5Cn%7C%20%5BImpacted%20Files%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056%3Fsrc%3Dpr%26el%3Dtree%29%20%7C%20Coverage%20%5Cu0394%20%7C%20%7C%5Cn%7C---%7C---%7C---%7C%5Cn%7C%20%5Bprivacyidea/models.py%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056/diff%3Fsrc%3Dpr%26el%3Dtree%23diff-cHJpdmFjeWlkZWEvbW9kZWxzLnB5%29%20%7C%20%6098.76%25%20%3C100%25%3E%20%28%5Cu00f8%29%60%20%7C%20%3Aarrow_up%3A%20%7C%5Cn%7C%20%5Bprivacyidea/lib/counter.py%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056/diff%3Fsrc%3Dpr%26el%3Dtree%23diff-cHJpdmFjeWlkZWEvbGliL2NvdW50ZXIucHk%3D%29%20%7C%20%6090.9%25%20%3C100%25%3E%20%28-9.1%25%29%60%20%7C%20%3Aarrow_down%3A%20%7C%5Cn%7C%20%5Bprivacyidea/lib/eventhandler/counterhandler.py%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056/diff%3Fsrc%3Dpr%26el%3Dtree%23diff-cHJpdmFjeWlkZWEvbGliL2V2ZW50aGFuZGxlci9jb3VudGVyaGFuZGxlci5weQ%3D%3D%29%20%7C%20%6067.85%25%20%3C27.27%25%3E%20%28-23.06%25%29%60%20%7C%20%3Aarrow_down%3A%20%7C%5Cn%7C%20%5Bprivacyidea/lib/policydecorators.py%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056/diff%3Fsrc%3Dpr%26el%3Dtree%23diff-cHJpdmFjeWlkZWEvbGliL3BvbGljeWRlY29yYXRvcnMucHk%3D%29%20%7C%20%6098.51%25%20%3C0%25%3E%20%28%2B0.59%25%29%60%20%7C%20%3Aarrow_up%3A%20%7C%5Cn%7C%20%5Bprivacyidea/lib/eventhandler/usernotification.py%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056/diff%3Fsrc%3Dpr%26el%3Dtree%23diff-cHJpdmFjeWlkZWEvbGliL2V2ZW50aGFuZGxlci91c2Vybm90aWZpY2F0aW9uLnB5%29%20%7C%20%6093.86%25%20%3C0%25%3E%20%28%2B3.43%25%29%60%20%7C%20%3Aarrow_up%3A%20%7C%5Cn%5Cn------%5Cn%5Cn%5BContinue%20to%20review%20full%20report%20at%20Codecov%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056%3Fsrc%3Dpr%26el%3Dcontinue%29.%5Cn%3E%20%2A%2ALegend%2A%2A%20-%20%5BClick%20here%20to%20learn%20more%5D%28https%3A//docs.codecov.io/docs/codecov-delta%29%5Cn%3E%20%60%5Cu0394%20%3D%20absolute%20%3Crelative%3E%20%28impact%29%60%2C%20%60%5Cu00f8%20%3D%20not%20affected%60%2C%20%60%3F%20%3D%20missing%20data%60%5Cn%3E%20Powered%20by%20%5BCodecov%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056%3Fsrc%3Dpr%26el%3Dfooter%29.%20Last%20update%20%5B519b0d1...9ba1b67%5D%28https%3A//codecov.io/gh/privacyidea/privacyidea/pull/1056%3Fsrc%3Dpr%26el%3Dlastupdated%29.%20Read%20the%20%5Bcomment%20docs%5D%28https%3A//docs.codecov.io/docs/pull-request-comments%29.%5Cn%22%2C%20%22created_at%22%3A%20%222018-05-08T16%3A19%3A00Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars0.githubusercontent.com/u/8655789%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/codecov-io%22%7D%7D%5D%2C%20%22title%22%3A%20%22General%20Comment%22%7D%2C%20%22Pull%200749b2697147ba8dfbfad0a32069f77ec29dd58e%20privacyidea/lib/eventhandler/counterhandler.py%2062%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186834422%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22I%20prefer%20no%20space%20here%21%20%3B-%29%22%2C%20%22created_at%22%3A%20%222018-05-08T19%3A03%3A50Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%3Ca%20href%3D%27%23crh-update-none%27%3E%3C/a%3E%22%2C%20%22created_at%22%3A%20%222018-05-11T08%3A45%3A08Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20privacyidea/lib/eventhandler/counterhandler.py%3AL82-105%22%7D%2C%20%22Pull%200749b2697147ba8dfbfad0a32069f77ec29dd58e%20doc/eventhandler/counterhandler.rst%2015%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186831816%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22Why%20did%20you%20change%20this%20to%20%2A%2Adescribe%2A%2A%3F%20The%20same%20heading%20is%20used%20in%20other%20docs.%5Cr%5CnAll%20other%20events%20use%20sub%20headers%2C%20too.%5Cr%5CnThe%20interesting%20thing%20about%20this%2C%20is%20that%20you%20can%20simply%20share%20a%20permanent%20link%20to%20this%20part%20of%20the%20doc.%5Cr%5CnSeems%20not%20to%20work%20with%20%2A%2Adescribe%2A%2A.%22%2C%20%22created_at%22%3A%20%222018-05-08T18%3A54%3A57Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%2C%20%7B%22body%22%3A%20%22just%20thought%20it%20looks%20nicer%20%3A-%29%5Cr%5CnMaybe%20we%20can%20change%20the%20sphinx%20config%20to%20avoid%20numbering%20all%20levels%20of%20subsections.%20It%20gets%20confusing%20if%20the%20length%20of%20the%20section%20number%20surpasses%20the%20text...%22%2C%20%22created_at%22%3A%20%222018-05-09T08%3A06%3A40Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars0.githubusercontent.com/u/37443810%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/plettich%22%7D%7D%2C%20%7B%22body%22%3A%20%22You%20are%20right.%20Skipping%20chapter%20numbering%20for%20lower%20levels%20might%20make%20sense.%5Cr%5CnJust%20let%20us%20keep%20this%20in%20a%20consistent%20way%20through%20the%20documentation%20and%20not%20change%20this%20in%20this%20PR.%22%2C%20%22created_at%22%3A%20%222018-05-09T09%3A02%3A27Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%3Ca%20href%3D%27%23crh-update-complete%27%3E%3C/a%3E%22%2C%20%22created_at%22%3A%20%222018-05-11T08%3A45%3A09Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20doc/eventhandler/counterhandler.rst%3AL7-46%22%7D%2C%20%22Pull%200749b2697147ba8dfbfad0a32069f77ec29dd58e%20privacyidea/lib/eventhandler/counterhandler.py%2020%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186834160%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22You%20must%20not%20remove%20this.%5Cr%5Cn%5Cr%5CnMy%20ui%20throws%5Cr%5Cn%5Cr%5Cn%20%20%20%20global%20name%20%27_%27%20is%20not%20defined%22%2C%20%22created_at%22%3A%20%222018-05-08T19%3A02%3A57Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%3Ca%20href%3D%27%23crh-update-none%27%3E%3C/a%3E%22%2C%20%22created_at%22%3A%20%222018-05-11T08%3A45%3A43Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20privacyidea/lib/eventhandler/counterhandler.py%3AL20-33%22%7D%2C%20%22Pull%200749b2697147ba8dfbfad0a32069f77ec29dd58e%20privacyidea/lib/eventhandler/counterhandler.py%202%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186832639%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22You%20can%20add%20a%20short%20info%20about%20adding%20decrease%20and%20reset.%22%2C%20%22created_at%22%3A%20%222018-05-08T18%3A57%3A33Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%22%2C%20%22created_at%22%3A%20%222018-05-11T08%3A47%3A05Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20privacyidea/lib/eventhandler/counterhandler.py%3AL1-8%22%7D%2C%20%22Pull%200749b2697147ba8dfbfad0a32069f77ec29dd58e%20privacyidea/models.py%2021%22%3A%20%7B%22html_url%22%3A%20%22https%3A//github.com/privacyidea/privacyidea/pull/1056%23discussion_r186835504%22%2C%20%22comments%22%3A%20%5B%7B%22body%22%3A%20%22This%20would%20mean%2C%20that%20the%20event%20handler%20was%20changed%20after%20the%20counter%20decreased%20under%20zero%20by%20previous%20events.%5Cr%5CnSo%20the%20current%20event%20handler%20definition%20would%20be%3A%20%5C%22Be%20not%20negative%5C%22.%5Cr%5Cn%5Cr%5CnMaybe%20we%20should%20reset%20the%20counter%20in%20this%20case%20to%20zero%3F%22%2C%20%22created_at%22%3A%20%222018-05-08T19%3A07%3A37Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%2C%20%7B%22body%22%3A%20%22%3A%2B1%3A%3Ca%20href%3D%27%23crh-update-complete%27%3E%3C/a%3E%22%2C%20%22created_at%22%3A%20%222018-05-11T08%3A45%3A44Z%22%2C%20%22user%22%3A%20%7B%22avatar_url%22%3A%20%22https%3A//avatars1.githubusercontent.com/u/1908620%3Fv%3D4%22%2C%20%22html_url%22%3A%20%22https%3A//github.com/cornelinux%22%7D%7D%5D%2C%20%22title%22%3A%20%22File%3A%20privacyidea/models.py%3AL2327-2354%22%7D%7D%7D'></a>\n<a href='https://www.codereviewhub.com/'><img src='http://www.codereviewhub.com/site/github-bar.png' height=40></a>\n- [ ] <a href='#crh-comment-General Comment'></a> <img src='http://www.codereviewhub.com/site/github-remaining.png' height=16 width=60>&nbsp;<b><a href='https://github.com/privacyidea/privacyidea/pull/1056#issuecomment-387458964'>General Comment</a></b>\n- <a href='https://github.com/codecov-io'><img border=0 src='https://avatars0.githubusercontent.com/u/8655789?v=4' height=16 width=16></a> # [Codecov](https://codecov.io/gh/privacyidea/privacyidea/pull/1056?src=pr&el=h1) Report\n> Merging [#1056](https://codecov.io/gh/privacyidea/privacyidea/pull/1056?src=pr&el=desc) into [master](https://codecov.io/gh/privacyidea/privacyidea/commit/519b0d1730d17c6b69a8b8b3c9379d576f7d3f7b?src=pr&el=desc) will **decrease** coverage by `<.01%`.\n> The diff coverage is `60%`.\n[![Impacted file tree graph](https://codecov.io/gh/privacyidea/privacyidea/pull/1056/graphs/tree.svg?token=7nHLZki60B&width=650&height=150&src=pr)](https://codecov.io/gh/privacyidea/privacyidea/pull/1056?src=pr&el=tree)\n```diff\n@@            Coverage Diff             @@\n##           master    #1056      +/-   ##\n==========================================\n- Coverage   95.41%   95.41%   -0.01%\n==========================================\nFiles         131      131\nLines       16211    16382     +171\n==========================================\n+ Hits        15468    15631     +163\n- Misses        743      751       +8\n```\n| [Impacted Files](https://codecov.io/gh/privacyidea/privacyidea/pull/1056?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [privacyidea/models.py](https://codecov.io/gh/privacyidea/privacyidea/pull/1056/diff?src=pr&el=tree#diff-cHJpdmFjeWlkZWEvbW9kZWxzLnB5) | `98.76% <100%> (ø)` | :arrow_up: |\n| [privacyidea/lib/counter.py](https://codecov.io/gh/privacyidea/privacyidea/pull/1056/diff?src=pr&el=tree#diff-cHJpdmFjeWlkZWEvbGliL2NvdW50ZXIucHk=) | `90.9% <100%> (-9.1%)` | :arrow_down: |\n| [privacyidea/lib/eventhandler/counterhandler.py](https://codecov.io/gh/privacyidea/privacyidea/pull/1056/diff?src=pr&el=tree#diff-cHJpdmFjeWlkZWEvbGliL2V2ZW50aGFuZGxlci9jb3VudGVyaGFuZGxlci5weQ==) | `67.85% <27.27%> (-23.06%)` | :arrow_down: |\n| [privacyidea/lib/policydecorators.py](https://codecov.io/gh/privacyidea/privacyidea/pull/1056/diff?src=pr&el=tree#diff-cHJpdmFjeWlkZWEvbGliL3BvbGljeWRlY29yYXRvcnMucHk=) | `98.51% <0%> (+0.59%)` | :arrow_up: |\n| [privacyidea/lib/eventhandler/usernotification.py](https://codecov.io/gh/privacyidea/privacyidea/pull/1056/diff?src=pr&el=tree#diff-cHJpdmFjeWlkZWEvbGliL2V2ZW50aGFuZGxlci91c2Vybm90aWZpY2F0aW9uLnB5) | `93.86% <0%> (+3.43%)` | :arrow_up: |\n------\n[Continue to review full report at Codecov](https://codecov.io/gh/privacyidea/privacyidea/pull/1056?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/privacyidea/privacyidea/pull/1056?src=pr&el=footer). Last update [519b0d1...9ba1b67](https://codecov.io/gh/privacyidea/privacyidea/pull/1056?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n- [x] <a href='#crh-comment-Pull 0749b2697147ba8dfbfad0a32069f77ec29dd58e doc/eventhandler/counterhandler.rst 15'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/privacyidea/privacyidea/pull/1056#discussion_r186831816'>File: doc/eventhandler/counterhandler.rst:L7-46</a></b>\n- <a href='https://github.com/cornelinux'><img border=0 src='https://avatars1.githubusercontent.com/u/1908620?v=4' height=16 width=16></a> Why did you change this to **describe**? The same heading is used in other docs.\nAll other events use sub headers, too.\nThe interesting thing about this, is that you can simply share a permanent link to this part of the doc.\nSeems not to work with **describe**.\n- <a href='https://github.com/plettich'><img border=0 src='https://avatars0.githubusercontent.com/u/37443810?v=4' height=16 width=16></a> just thought it looks nicer :-)\nMaybe we can change the sphinx config to avoid numbering all levels of subsections. It gets confusing if the length of the section number surpasses the text...\n- <a href='https://github.com/cornelinux'><img border=0 src='https://avatars1.githubusercontent.com/u/1908620?v=4' height=16 width=16></a> You are right. Skipping chapter numbering for lower levels might make sense.\nJust let us keep this in a consistent way through the documentation and not change this in this PR.\n- [x] <a href='#crh-comment-Pull 0749b2697147ba8dfbfad0a32069f77ec29dd58e privacyidea/lib/eventhandler/counterhandler.py 2'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/privacyidea/privacyidea/pull/1056#discussion_r186832639'>File: privacyidea/lib/eventhandler/counterhandler.py:L1-8</a></b>\n- <a href='https://github.com/cornelinux'><img border=0 src='https://avatars1.githubusercontent.com/u/1908620?v=4' height=16 width=16></a> You can add a short info about adding decrease and reset.\n- [x] <a href='#crh-comment-Pull 0749b2697147ba8dfbfad0a32069f77ec29dd58e privacyidea/lib/eventhandler/counterhandler.py 20'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/privacyidea/privacyidea/pull/1056#discussion_r186834160'>File: privacyidea/lib/eventhandler/counterhandler.py:L20-33</a></b>\n- <a href='https://github.com/cornelinux'><img border=0 src='https://avatars1.githubusercontent.com/u/1908620?v=4' height=16 width=16></a> You must not remove this.\nMy ui throws\nglobal name '_' is not defined\n- [x] <a href='#crh-comment-Pull 0749b2697147ba8dfbfad0a32069f77ec29dd58e privacyidea/lib/eventhandler/counterhandler.py 62'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/privacyidea/privacyidea/pull/1056#discussion_r186834422'>File: privacyidea/lib/eventhandler/counterhandler.py:L82-105</a></b>\n- <a href='https://github.com/cornelinux'><img border=0 src='https://avatars1.githubusercontent.com/u/1908620?v=4' height=16 width=16></a> I prefer no space here! ;-)\n- [x] <a href='#crh-comment-Pull 0749b2697147ba8dfbfad0a32069f77ec29dd58e privacyidea/models.py 21'></a> <img src='http://www.codereviewhub.com/site/github-completed.png' height=16 width=60>&nbsp;<b><a href='https://github.com/privacyidea/privacyidea/pull/1056#discussion_r186835504'>File: privacyidea/models.py:L2327-2354</a></b>\n- <a href='https://github.com/cornelinux'><img border=0 src='https://avatars1.githubusercontent.com/u/1908620?v=4' height=16 width=16></a> This would mean, that the event handler was changed after the counter decreased under zero by previous events.\nSo the current event handler definition would be: \"Be not negative\".\nMaybe we should reset the counter in this case to zero?\n\n\n<a href='https://www.codereviewhub.com/privacyidea/privacyidea/pull/1056?mark_as_completed=1'><img src='http://www.codereviewhub.com/site/github-mark-as-completed.png' height=26></a>&nbsp;<a href='https://www.codereviewhub.com/privacyidea/privacyidea/pull/1056?approve=1'><img src='http://www.codereviewhub.com/site/github-approve.png' height=26></a>&nbsp;<a href='https://github.com/privacyidea/privacyidea/pull/1056'><img src='http://www.codereviewhub.com/site/github-refresh.png' height=26></a>\n<a href='#crh-end'></a>","created_at":"2018-05-08T15:35:41Z","updated_at":"2018-05-11T08:49:27Z","closed_at":"2018-05-11T08:49:26Z","merged_at":"2018-05-11T08:49:26Z","merge_commit_sha":"93b86b9b1a886978771a452bc8d47cbae281ea6c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"contributors","id":2148303,"slug":"contributors","description":"","privacy":"closed","url":"https://api.github.com/teams/2148303","members_url":"https://api.github.com/teams/2148303/members{/member}","repositories_url":"https://api.github.com/teams/2148303/repos","permission":"pull"}],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/privacyidea/privacyidea/pulls/1056/commits","review_comments_url":"https://api.github.com/repos/privacyidea/privacyidea/pulls/1056/comments","review_comment_url":"https://api.github.com/repos/privacyidea/privacyidea/pulls/comments{/number}","comments_url":"https://api.github.com/repos/privacyidea/privacyidea/issues/1056/comments","statuses_url":"https://api.github.com/repos/privacyidea/privacyidea/statuses/9ba1b673e72449339577c9609162786de3870fc6","head":{"label":"privacyidea:991/improve_counter_handler","ref":"991/improve_counter_handler","sha":"9ba1b673e72449339577c9609162786de3870fc6","user":{"login":"privacyidea","id":7519615,"avatar_url":"https://avatars3.githubusercontent.com/u/7519615?v=4","gravatar_id":"","url":"https://api.github.com/users/privacyidea","html_url":"https://github.com/privacyidea","followers_url":"https://api.github.com/users/privacyidea/followers","following_url":"https://api.github.com/users/privacyidea/following{/other_user}","gists_url":"https://api.github.com/users/privacyidea/gists{/gist_id}","starred_url":"https://api.github.com/users/privacyidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privacyidea/subscriptions","organizations_url":"https://api.github.com/users/privacyidea/orgs","repos_url":"https://api.github.com/users/privacyidea/repos","events_url":"https://api.github.com/users/privacyidea/events{/privacy}","received_events_url":"https://api.github.com/users/privacyidea/received_events","type":"Organization","site_admin":false},"repo":{"id":20446681,"name":"privacyidea","full_name":"privacyidea/privacyidea","owner":{"login":"privacyidea","id":7519615,"avatar_url":"https://avatars3.githubusercontent.com/u/7519615?v=4","gravatar_id":"","url":"https://api.github.com/users/privacyidea","html_url":"https://github.com/privacyidea","followers_url":"https://api.github.com/users/privacyidea/followers","following_url":"https://api.github.com/users/privacyidea/following{/other_user}","gists_url":"https://api.github.com/users/privacyidea/gists{/gist_id}","starred_url":"https://api.github.com/users/privacyidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privacyidea/subscriptions","organizations_url":"https://api.github.com/users/privacyidea/orgs","repos_url":"https://api.github.com/users/privacyidea/repos","events_url":"https://api.github.com/users/privacyidea/events{/privacy}","received_events_url":"https://api.github.com/users/privacyidea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/privacyidea/privacyidea","description":":closed_lock_with_key: multi factor authentication system (2FA, MFA, OTP Server)","fork":false,"url":"https://api.github.com/repos/privacyidea/privacyidea","forks_url":"https://api.github.com/repos/privacyidea/privacyidea/forks","keys_url":"https://api.github.com/repos/privacyidea/privacyidea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privacyidea/privacyidea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privacyidea/privacyidea/teams","hooks_url":"https://api.github.com/repos/privacyidea/privacyidea/hooks","issue_events_url":"https://api.github.com/repos/privacyidea/privacyidea/issues/events{/number}","events_url":"https://api.github.com/repos/privacyidea/privacyidea/events","assignees_url":"https://api.github.com/repos/privacyidea/privacyidea/assignees{/user}","branches_url":"https://api.github.com/repos/privacyidea/privacyidea/branches{/branch}","tags_url":"https://api.github.com/repos/privacyidea/privacyidea/tags","blobs_url":"https://api.github.com/repos/privacyidea/privacyidea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privacyidea/privacyidea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privacyidea/privacyidea/git/refs{/sha}","trees_url":"https://api.github.com/repos/privacyidea/privacyidea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privacyidea/privacyidea/statuses/{sha}","languages_url":"https://api.github.com/repos/privacyidea/privacyidea/languages","stargazers_url":"https://api.github.com/repos/privacyidea/privacyidea/stargazers","contributors_url":"https://api.github.com/repos/privacyidea/privacyidea/contributors","subscribers_url":"https://api.github.com/repos/privacyidea/privacyidea/subscribers","subscription_url":"https://api.github.com/repos/privacyidea/privacyidea/subscription","commits_url":"https://api.github.com/repos/privacyidea/privacyidea/commits{/sha}","git_commits_url":"https://api.github.com/repos/privacyidea/privacyidea/git/commits{/sha}","comments_url":"https://api.github.com/repos/privacyidea/privacyidea/comments{/number}","issue_comment_url":"https://api.github.com/repos/privacyidea/privacyidea/issues/comments{/number}","contents_url":"https://api.github.com/repos/privacyidea/privacyidea/contents/{+path}","compare_url":"https://api.github.com/repos/privacyidea/privacyidea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privacyidea/privacyidea/merges","archive_url":"https://api.github.com/repos/privacyidea/privacyidea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privacyidea/privacyidea/downloads","issues_url":"https://api.github.com/repos/privacyidea/privacyidea/issues{/number}","pulls_url":"https://api.github.com/repos/privacyidea/privacyidea/pulls{/number}","milestones_url":"https://api.github.com/repos/privacyidea/privacyidea/milestones{/number}","notifications_url":"https://api.github.com/repos/privacyidea/privacyidea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privacyidea/privacyidea/labels{/name}","releases_url":"https://api.github.com/repos/privacyidea/privacyidea/releases{/id}","deployments_url":"https://api.github.com/repos/privacyidea/privacyidea/deployments","created_at":"2014-06-03T14:47:02Z","updated_at":"2018-05-10T09:06:12Z","pushed_at":"2018-05-11T08:49:26Z","git_url":"git://github.com/privacyidea/privacyidea.git","ssh_url":"git@github.com:privacyidea/privacyidea.git","clone_url":"https://github.com/privacyidea/privacyidea.git","svn_url":"https://github.com/privacyidea/privacyidea","homepage":"http://www.privacyidea.org","size":26657,"stargazers_count":405,"watchers_count":405,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":117,"mirror_url":null,"archived":false,"open_issues_count":83,"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"},"forks":117,"open_issues":83,"watchers":405,"default_branch":"master"}},"base":{"label":"privacyidea:master","ref":"master","sha":"519b0d1730d17c6b69a8b8b3c9379d576f7d3f7b","user":{"login":"privacyidea","id":7519615,"avatar_url":"https://avatars3.githubusercontent.com/u/7519615?v=4","gravatar_id":"","url":"https://api.github.com/users/privacyidea","html_url":"https://github.com/privacyidea","followers_url":"https://api.github.com/users/privacyidea/followers","following_url":"https://api.github.com/users/privacyidea/following{/other_user}","gists_url":"https://api.github.com/users/privacyidea/gists{/gist_id}","starred_url":"https://api.github.com/users/privacyidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privacyidea/subscriptions","organizations_url":"https://api.github.com/users/privacyidea/orgs","repos_url":"https://api.github.com/users/privacyidea/repos","events_url":"https://api.github.com/users/privacyidea/events{/privacy}","received_events_url":"https://api.github.com/users/privacyidea/received_events","type":"Organization","site_admin":false},"repo":{"id":20446681,"name":"privacyidea","full_name":"privacyidea/privacyidea","owner":{"login":"privacyidea","id":7519615,"avatar_url":"https://avatars3.githubusercontent.com/u/7519615?v=4","gravatar_id":"","url":"https://api.github.com/users/privacyidea","html_url":"https://github.com/privacyidea","followers_url":"https://api.github.com/users/privacyidea/followers","following_url":"https://api.github.com/users/privacyidea/following{/other_user}","gists_url":"https://api.github.com/users/privacyidea/gists{/gist_id}","starred_url":"https://api.github.com/users/privacyidea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/privacyidea/subscriptions","organizations_url":"https://api.github.com/users/privacyidea/orgs","repos_url":"https://api.github.com/users/privacyidea/repos","events_url":"https://api.github.com/users/privacyidea/events{/privacy}","received_events_url":"https://api.github.com/users/privacyidea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/privacyidea/privacyidea","description":":closed_lock_with_key: multi factor authentication system (2FA, MFA, OTP Server)","fork":false,"url":"https://api.github.com/repos/privacyidea/privacyidea","forks_url":"https://api.github.com/repos/privacyidea/privacyidea/forks","keys_url":"https://api.github.com/repos/privacyidea/privacyidea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/privacyidea/privacyidea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/privacyidea/privacyidea/teams","hooks_url":"https://api.github.com/repos/privacyidea/privacyidea/hooks","issue_events_url":"https://api.github.com/repos/privacyidea/privacyidea/issues/events{/number}","events_url":"https://api.github.com/repos/privacyidea/privacyidea/events","assignees_url":"https://api.github.com/repos/privacyidea/privacyidea/assignees{/user}","branches_url":"https://api.github.com/repos/privacyidea/privacyidea/branches{/branch}","tags_url":"https://api.github.com/repos/privacyidea/privacyidea/tags","blobs_url":"https://api.github.com/repos/privacyidea/privacyidea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/privacyidea/privacyidea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/privacyidea/privacyidea/git/refs{/sha}","trees_url":"https://api.github.com/repos/privacyidea/privacyidea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/privacyidea/privacyidea/statuses/{sha}","languages_url":"https://api.github.com/repos/privacyidea/privacyidea/languages","stargazers_url":"https://api.github.com/repos/privacyidea/privacyidea/stargazers","contributors_url":"https://api.github.com/repos/privacyidea/privacyidea/contributors","subscribers_url":"https://api.github.com/repos/privacyidea/privacyidea/subscribers","subscription_url":"https://api.github.com/repos/privacyidea/privacyidea/subscription","commits_url":"https://api.github.com/repos/privacyidea/privacyidea/commits{/sha}","git_commits_url":"https://api.github.com/repos/privacyidea/privacyidea/git/commits{/sha}","comments_url":"https://api.github.com/repos/privacyidea/privacyidea/comments{/number}","issue_comment_url":"https://api.github.com/repos/privacyidea/privacyidea/issues/comments{/number}","contents_url":"https://api.github.com/repos/privacyidea/privacyidea/contents/{+path}","compare_url":"https://api.github.com/repos/privacyidea/privacyidea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/privacyidea/privacyidea/merges","archive_url":"https://api.github.com/repos/privacyidea/privacyidea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/privacyidea/privacyidea/downloads","issues_url":"https://api.github.com/repos/privacyidea/privacyidea/issues{/number}","pulls_url":"https://api.github.com/repos/privacyidea/privacyidea/pulls{/number}","milestones_url":"https://api.github.com/repos/privacyidea/privacyidea/milestones{/number}","notifications_url":"https://api.github.com/repos/privacyidea/privacyidea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/privacyidea/privacyidea/labels{/name}","releases_url":"https://api.github.com/repos/privacyidea/privacyidea/releases{/id}","deployments_url":"https://api.github.com/repos/privacyidea/privacyidea/deployments","created_at":"2014-06-03T14:47:02Z","updated_at":"2018-05-10T09:06:12Z","pushed_at":"2018-05-11T08:49:26Z","git_url":"git://github.com/privacyidea/privacyidea.git","ssh_url":"git@github.com:privacyidea/privacyidea.git","clone_url":"https://github.com/privacyidea/privacyidea.git","svn_url":"https://github.com/privacyidea/privacyidea","homepage":"http://www.privacyidea.org","size":26657,"stargazers_count":405,"watchers_count":405,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":117,"mirror_url":null,"archived":false,"open_issues_count":83,"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"},"forks":117,"open_issues":83,"watchers":405,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/privacyidea/privacyidea/pulls/1056"},"html":{"href":"https://github.com/privacyidea/privacyidea/pull/1056"},"issue":{"href":"https://api.github.com/repos/privacyidea/privacyidea/issues/1056"},"comments":{"href":"https://api.github.com/repos/privacyidea/privacyidea/issues/1056/comments"},"review_comments":{"href":"https://api.github.com/repos/privacyidea/privacyidea/pulls/1056/comments"},"review_comment":{"href":"https://api.github.com/repos/privacyidea/privacyidea/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/privacyidea/privacyidea/pulls/1056/commits"},"statuses":{"href":"https://api.github.com/repos/privacyidea/privacyidea/statuses/9ba1b673e72449339577c9609162786de3870fc6"}},"author_association":"NONE","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"cornelinux","id":1908620,"avatar_url":"https://avatars1.githubusercontent.com/u/1908620?v=4","gravatar_id":"","url":"https://api.github.com/users/cornelinux","html_url":"https://github.com/cornelinux","followers_url":"https://api.github.com/users/cornelinux/followers","following_url":"https://api.github.com/users/cornelinux/following{/other_user}","gists_url":"https://api.github.com/users/cornelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/cornelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cornelinux/subscriptions","organizations_url":"https://api.github.com/users/cornelinux/orgs","repos_url":"https://api.github.com/users/cornelinux/repos","events_url":"https://api.github.com/users/cornelinux/events{/privacy}","received_events_url":"https://api.github.com/users/cornelinux/received_events","type":"User","site_admin":false},"comments":1,"review_comments":12,"maintainer_can_modify":false,"commits":2,"additions":214,"deletions":22,"changed_files":7}}
{"actor":{"display_login":"cornelinux"}}