{"action":"created","issue":{"url":"https://api.github.com/repos/divio/django-cms/issues/4382","labels_url":"https://api.github.com/repos/divio/django-cms/issues/4382/labels{/name}","comments_url":"https://api.github.com/repos/divio/django-cms/issues/4382/comments","events_url":"https://api.github.com/repos/divio/django-cms/issues/4382/events","html_url":"https://github.com/divio/django-cms/issues/4382","id":103217740,"number":4382,"title":"get_template magic inherits from root, not nearest node","user":{"login":"jankopacek","id":683626,"avatar_url":"https://avatars.githubusercontent.com/u/683626?v=3","gravatar_id":"","url":"https://api.github.com/users/jankopacek","html_url":"https://github.com/jankopacek","followers_url":"https://api.github.com/users/jankopacek/followers","following_url":"https://api.github.com/users/jankopacek/following{/other_user}","gists_url":"https://api.github.com/users/jankopacek/gists{/gist_id}","starred_url":"https://api.github.com/users/jankopacek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jankopacek/subscriptions","organizations_url":"https://api.github.com/users/jankopacek/orgs","repos_url":"https://api.github.com/users/jankopacek/repos","events_url":"https://api.github.com/users/jankopacek/events{/privacy}","received_events_url":"https://api.github.com/users/jankopacek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-26T09:13:29Z","updated_at":"2015-08-27T05:47:32Z","closed_at":null,"body":"Template inheritance wrong behavior?\r\nIn models/pagemodel.py\r\n\r\n```python\r\ndef get_template(self):\r\n        \"\"\"\r\n        get the template of this page if defined or if closer parent if\r\n        defined or DEFAULT_PAGE_TEMPLATE otherwise\r\n        \"\"\"\r\n        if hasattr(self, '_template_cache'):\r\n            return self._template_cache\r\n        template = None\r\n        if self.template:\r\n            if self.template != constants.TEMPLATE_INHERITANCE_MAGIC:\r\n                template = self.template\r\n            else:\r\n                try:\r\n                    template = self.get_ancestors().exclude(\r\n                        template=constants.TEMPLATE_INHERITANCE_MAGIC).values_list('template', flat=True)[0]\r\n                except IndexError:\r\n                    pass\r\n        if not template:\r\n            template = get_cms_setting('TEMPLATES')[0][0]\r\n        self._template_cache = template\r\n        return template\r\n```\r\n\r\nThis returns not the closer parent, but first from get_ancestors - which in MP is root node. Is this an intention?"},"comment":{"url":"https://api.github.com/repos/divio/django-cms/issues/comments/135301460","html_url":"https://github.com/divio/django-cms/issues/4382#issuecomment-135301460","issue_url":"https://api.github.com/repos/divio/django-cms/issues/4382","id":135301460,"user":{"login":"yakky","id":714711,"avatar_url":"https://avatars.githubusercontent.com/u/714711?v=3","gravatar_id":"","url":"https://api.github.com/users/yakky","html_url":"https://github.com/yakky","followers_url":"https://api.github.com/users/yakky/followers","following_url":"https://api.github.com/users/yakky/following{/other_user}","gists_url":"https://api.github.com/users/yakky/gists{/gist_id}","starred_url":"https://api.github.com/users/yakky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yakky/subscriptions","organizations_url":"https://api.github.com/users/yakky/orgs","repos_url":"https://api.github.com/users/yakky/repos","events_url":"https://api.github.com/users/yakky/events{/privacy}","received_events_url":"https://api.github.com/users/yakky/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T05:47:32Z","updated_at":"2015-08-27T05:47:32Z","body":"This is fixed in #4363"}}