{"action":"created","issue":{"url":"https://api.github.com/repos/taigaio/taiga-back/issues/636","repository_url":"https://api.github.com/repos/taigaio/taiga-back","labels_url":"https://api.github.com/repos/taigaio/taiga-back/issues/636/labels{/name}","comments_url":"https://api.github.com/repos/taigaio/taiga-back/issues/636/comments","events_url":"https://api.github.com/repos/taigaio/taiga-back/issues/636/events","html_url":"https://github.com/taigaio/taiga-back/issues/636","id":136479353,"number":636,"title":"is_owner / is_admin mismatch","user":{"login":"smarek","id":384824,"avatar_url":"https://avatars.githubusercontent.com/u/384824?v=3","gravatar_id":"","url":"https://api.github.com/users/smarek","html_url":"https://github.com/smarek","followers_url":"https://api.github.com/users/smarek/followers","following_url":"https://api.github.com/users/smarek/following{/other_user}","gists_url":"https://api.github.com/users/smarek/gists{/gist_id}","starred_url":"https://api.github.com/users/smarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarek/subscriptions","organizations_url":"https://api.github.com/users/smarek/orgs","repos_url":"https://api.github.com/users/smarek/repos","events_url":"https://api.github.com/users/smarek/events{/privacy}","received_events_url":"https://api.github.com/users/smarek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-25T19:02:16Z","updated_at":"2016-02-28T11:33:22Z","closed_at":null,"body":"Hi, \r\n\r\nrecently I've upgraded stable to latest revision, and even after having all the migrations run, there was problem with `is_owner` vs. `is_admin` column naming.\r\n\r\nI have manually renamed the column `is_admin` to `is_owner`, and the problem was fixed, but I don't know how things could have gotten to such state.\r\n\r\nCould you please let me know, if there is anything you know about that could cause such problems, or if it is possible to create a fixup for this, so it won't happen in the future?\r\n\r\nThank you\r\n\r\nStacktrace as follows (from `gunicorn.stdout.log`):\r\n```\r\nInternal Server Error: /api/v1/projects\r\nTraceback (most recent call last):\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/backends/utils.py\", line 64, in execute\r\n    return self.cursor.execute(sql, params)\r\npsycopg2.ProgrammingError: column projects_membership.is_owner does not exist\r\nLINE 1: ...p\".\"project_id\", \"projects_membership\".\"role_id\", \"projects_...\r\n                                                             ^\r\n\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/core/handlers/base.py\", line 132, in get_response\r\n    response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/viewsets.py\", line 105, in view\r\n    return self.dispatch(request, *args, **kwargs)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/views/decorators/csrf.py\", line 58, in wrapped_view\r\n    return view_func(*args, **kwargs)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/views.py\", line 444, in dispatch\r\n    response = self.handle_exception(exc)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/views.py\", line 441, in dispatch\r\n    response = handler(request, *args, **kwargs)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/mixins.py\", line 139, in list\r\n    return response.Ok(serializer.data)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/serializers.py\", line 613, in data\r\n    self._data = [self.to_native(item) for item in obj]\r\n  File \"/home/taiga/taiga-back/taiga/base/api/serializers.py\", line 613, in <listcomp>\r\n    self._data = [self.to_native(item) for item in obj]\r\n  File \"/home/taiga/taiga-back/taiga/base/api/serializers.py\", line 396, in to_native\r\n    value = field.field_to_native(obj, field_name)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/fields.py\", line 1082, in field_to_native\r\n    value = getattr(self.parent, self.method_name)(obj)\r\n  File \"/home/taiga/taiga-back/taiga/projects/serializers.py\", line 266, in get_my_permissions\r\n    return get_user_project_permissions(self.context[\"request\"].user, obj)\r\n  File \"/home/taiga/taiga-back/taiga/permissions/service.py\", line 80, in get_user_project_permissions\r\n    membership = _get_user_project_membership(user, project)\r\n  File \"/home/taiga/taiga-back/taiga/permissions/service.py\", line 28, in _get_user_project_membership\r\n    return user.cached_membership_for_project(project)\r\n  File \"/home/taiga/taiga-back/taiga/users/models.py\", line 159, in cached_membership_for_project\r\n    self._fill_cached_memberships()\r\n  File \"/home/taiga/taiga-back/taiga/users/models.py\", line 147, in _fill_cached_memberships\r\n    for membership in qs.all():\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/query.py\", line 162, in __iter__\r\n    self._fetch_all()\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/query.py\", line 965, in _fetch_all\r\n    self._result_cache = list(self.iterator())\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/query.py\", line 238, in iterator\r\n    results = compiler.execute_sql()\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/models/sql/compiler.py\", line 840, in execute_sql\r\n    cursor.execute(sql, params)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/backends/utils.py\", line 64, in execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/utils.py\", line 98, in __exit__\r\n    six.reraise(dj_exc_type, dj_exc_value, traceback)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/utils/six.py\", line 658, in reraise\r\n    raise value.with_traceback(tb)\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/db/backends/utils.py\", line 64, in execute\r\n    return self.cursor.execute(sql, params)\r\ndjango.db.utils.ProgrammingError: column projects_membership.is_owner does not exist\r\nLINE 1: ...p\".\"project_id\", \"projects_membership\".\"role_id\", \"projects_...\r\n```"},"comment":{"url":"https://api.github.com/repos/taigaio/taiga-back/issues/comments/189848445","html_url":"https://github.com/taigaio/taiga-back/issues/636#issuecomment-189848445","issue_url":"https://api.github.com/repos/taigaio/taiga-back/issues/636","id":189848445,"user":{"login":"smarek","id":384824,"avatar_url":"https://avatars.githubusercontent.com/u/384824?v=3","gravatar_id":"","url":"https://api.github.com/users/smarek","html_url":"https://github.com/smarek","followers_url":"https://api.github.com/users/smarek/followers","following_url":"https://api.github.com/users/smarek/following{/other_user}","gists_url":"https://api.github.com/users/smarek/gists{/gist_id}","starred_url":"https://api.github.com/users/smarek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarek/subscriptions","organizations_url":"https://api.github.com/users/smarek/orgs","repos_url":"https://api.github.com/users/smarek/repos","events_url":"https://api.github.com/users/smarek/events{/privacy}","received_events_url":"https://api.github.com/users/smarek/received_events","type":"User","site_admin":false},"created_at":"2016-02-28T11:33:22Z","updated_at":"2016-02-28T11:33:22Z","body":"Probably this could be connected, now, when I access API userstories, error will roll out\r\n\r\n```\r\nInternal Server Error: /api/v1/userstories\r\nTraceback (most recent call last):\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/core/handlers/base.py\", line 164, in get_response\r\n    response = response.render()\r\n  File \"/home/taiga/.virtualenvs/taiga/lib/python3.4/site-packages/django/template/response.py\", line 158, in render\r\n    self.content = self.rendered_content\r\n  File \"/home/taiga/taiga-back/taiga/base/response.py\", line 98, in rendered_content\r\n    ret = renderer.render(self.data, media_type, context)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/renderers.py\", line 632, in render\r\n    context = self.get_context(data, accepted_media_type, renderer_context)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/renderers.py\", line 582, in get_context\r\n    raw_data_post_form = self.get_raw_data_form(view, \"POST\", request)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/renderers.py\", line 532, in get_raw_data_form\r\n    content = renderer.render(serializer.data, accepted, context)\r\n  File \"/home/taiga/taiga-back/taiga/base/api/serializers.py\", line 615, in data\r\n    self._data = self.to_native(obj)\r\n  File \"/home/taiga/taiga-back/taiga/projects/notifications/mixins.py\", line 242, in to_native\r\n    obj.is_watcher = user.id in obj.watchers\r\nAttributeError: 'NoneType' object has no attribute 'watchers'\r\n```"}}