{"action":"created","issue":{"url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/4873","repository_url":"https://api.github.com/repos/zestedesavoir/zds-site","labels_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/4873/labels{/name}","comments_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/4873/comments","events_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/4873/events","html_url":"https://github.com/zestedesavoir/zds-site/pull/4873","id":296199259,"node_id":"MDExOlB1bGxSZXF1ZXN0MTY4NDU5MDE5","number":4873,"title":"S'assures que les comptes du bot et des utilisateurs anonymes et externes existent au lancement","user":{"login":"rezemika","id":1690660,"node_id":"MDQ6VXNlcjE2OTA2NjA=","avatar_url":"https://avatars0.githubusercontent.com/u/1690660?v=4","gravatar_id":"","url":"https://api.github.com/users/rezemika","html_url":"https://github.com/rezemika","followers_url":"https://api.github.com/users/rezemika/followers","following_url":"https://api.github.com/users/rezemika/following{/other_user}","gists_url":"https://api.github.com/users/rezemika/gists{/gist_id}","starred_url":"https://api.github.com/users/rezemika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rezemika/subscriptions","organizations_url":"https://api.github.com/users/rezemika/orgs","repos_url":"https://api.github.com/users/rezemika/repos","events_url":"https://api.github.com/users/rezemika/events{/privacy}","received_events_url":"https://api.github.com/users/rezemika/received_events","type":"User","site_admin":false},"labels":[{"id":104879870,"node_id":"MDU6TGFiZWwxMDQ4Nzk4NzA=","url":"https://api.github.com/repos/zestedesavoir/zds-site/labels/C-Back","name":"C-Back","color":"1834a5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-11T15:41:19Z","updated_at":"2018-08-03T15:01:13Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/zestedesavoir/zds-site/pulls/4873","html_url":"https://github.com/zestedesavoir/zds-site/pull/4873","diff_url":"https://github.com/zestedesavoir/zds-site/pull/4873.diff","patch_url":"https://github.com/zestedesavoir/zds-site/pull/4873.patch"},"body":"Le compte du bot était récupéré par des `get_object_or_404(User, username=settings.ZDS_APP['member']['bot_account'])`.\r\nOr, si celui-ci n'existe pas sur l'instance, cela lève une erreur 404 alors qu'il s'agit d'un problème de configuration.\r\nDésormais, la présence de ces comptes est vérifiée au lancement, et une exception est levée si l'un d'eux est introuvable.\r\n\r\nPuisqu'ils sont présents avec certitude sur l'instance, les appels de `get_object_or_404()` sont remplacés par `User.objects.get()`.\r\n\r\nNuméro du ticket concerné : #4872 \r\n\r\n### Contrôle qualité\r\n\r\n  - Vérifiez que les compte du bot, de l'utilisateur externe et de l'utilisateur anonyme sont toujours fonctionnels, et qu'une exception est levée au lancement s'ils sont absents.\r\n"},"comment":{"url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/comments/410280972","html_url":"https://github.com/zestedesavoir/zds-site/pull/4873#issuecomment-410280972","issue_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/4873","id":410280972,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDI4MDk3Mg==","user":{"login":"pierre-24","id":7889675,"node_id":"MDQ6VXNlcjc4ODk2NzU=","avatar_url":"https://avatars1.githubusercontent.com/u/7889675?v=4","gravatar_id":"","url":"https://api.github.com/users/pierre-24","html_url":"https://github.com/pierre-24","followers_url":"https://api.github.com/users/pierre-24/followers","following_url":"https://api.github.com/users/pierre-24/following{/other_user}","gists_url":"https://api.github.com/users/pierre-24/gists{/gist_id}","starred_url":"https://api.github.com/users/pierre-24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierre-24/subscriptions","organizations_url":"https://api.github.com/users/pierre-24/orgs","repos_url":"https://api.github.com/users/pierre-24/repos","events_url":"https://api.github.com/users/pierre-24/events{/privacy}","received_events_url":"https://api.github.com/users/pierre-24/received_events","type":"User","site_admin":false},"created_at":"2018-08-03T15:01:13Z","updated_at":"2018-08-03T15:01:13Z","author_association":"MEMBER","body":"Dixit Travis:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/travis/build/zestedesavoir/zds-site/zds/__init__.py\", line 32, in <module>\r\n    test = User.objects.get(username=username)\r\nNameError: name 'User' is not defined\r\nDuring handling of the above exception, another exception occurred:\r\nTraceback (most recent call last):\r\n  File \"manage.py\", line 47, in <module>\r\n    execute_from_command_line(sys.argv)\r\n  File \"/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/django/core/management/__init__.py\", line 367, in execute_from_command_line\r\n    utility.execute()\r\n  File \"/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/django/core/management/__init__.py\", line 316, in execute\r\n    settings.INSTALLED_APPS\r\n  File \"/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/django/conf/__init__.py\", line 53, in __getattr__\r\n    self._setup(name)\r\n  File \"/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/django/conf/__init__.py\", line 41, in _setup\r\n    self._wrapped = Settings(settings_module)\r\n  File \"/home/travis/virtualenv/python3.4.6/lib/python3.4/site-packages/django/conf/__init__.py\", line 97, in __init__\r\n    mod = importlib.import_module(self.SETTINGS_MODULE)\r\n  File \"/home/travis/virtualenv/python3.4.6/lib/python3.4/importlib/__init__.py\", line 109, in import_module\r\n    return _bootstrap._gcd_import(name[level:], package, level)\r\n  File \"<frozen importlib._bootstrap>\", line 2254, in _gcd_import\r\n  File \"<frozen importlib._bootstrap>\", line 2237, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 2212, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 321, in _call_with_frames_removed\r\n  File \"<frozen importlib._bootstrap>\", line 2254, in _gcd_import\r\n  File \"<frozen importlib._bootstrap>\", line 2237, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 2212, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 321, in _call_with_frames_removed\r\n  File \"<frozen importlib._bootstrap>\", line 2254, in _gcd_import\r\n  File \"<frozen importlib._bootstrap>\", line 2237, in _find_and_load\r\n  File \"<frozen importlib._bootstrap>\", line 2226, in _find_and_load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 1200, in _load_unlocked\r\n  File \"<frozen importlib._bootstrap>\", line 1129, in _exec\r\n  File \"<frozen importlib._bootstrap>\", line 1471, in exec_module\r\n  File \"<frozen importlib._bootstrap>\", line 321, in _call_with_frames_removed\r\n  File \"/home/travis/build/zestedesavoir/zds-site/zds/__init__.py\", line 33, in <module>\r\n    except User.DoesNotExist:\r\nNameError: name 'User' is not defined\r\n```"}}
{"actor":{"display_login":"pierre-24"}}