{"action":"created","issue":{"url":"https://api.github.com/repos/proycon/flat/issues/73","repository_url":"https://api.github.com/repos/proycon/flat","labels_url":"https://api.github.com/repos/proycon/flat/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/proycon/flat/issues/73/comments","events_url":"https://api.github.com/repos/proycon/flat/issues/73/events","html_url":"https://github.com/proycon/flat/issues/73","id":182878696,"number":73,"title":"IntegrityError after setting value in Metadata Editor","user":{"login":"kercos","id":2836492,"avatar_url":"https://avatars.githubusercontent.com/u/2836492?v=3","gravatar_id":"","url":"https://api.github.com/users/kercos","html_url":"https://github.com/kercos","followers_url":"https://api.github.com/users/kercos/followers","following_url":"https://api.github.com/users/kercos/following{/other_user}","gists_url":"https://api.github.com/users/kercos/gists{/gist_id}","starred_url":"https://api.github.com/users/kercos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kercos/subscriptions","organizations_url":"https://api.github.com/users/kercos/orgs","repos_url":"https://api.github.com/users/kercos/repos","events_url":"https://api.github.com/users/kercos/events{/privacy}","received_events_url":"https://api.github.com/users/kercos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/proycon/flat/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/proycon/flat/labels/PRIORITY","name":"PRIORITY","color":"fbca04"}],"state":"closed","locked":false,"assignee":{"login":"proycon","id":75427,"avatar_url":"https://avatars.githubusercontent.com/u/75427?v=3","gravatar_id":"","url":"https://api.github.com/users/proycon","html_url":"https://github.com/proycon","followers_url":"https://api.github.com/users/proycon/followers","following_url":"https://api.github.com/users/proycon/following{/other_user}","gists_url":"https://api.github.com/users/proycon/gists{/gist_id}","starred_url":"https://api.github.com/users/proycon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proycon/subscriptions","organizations_url":"https://api.github.com/users/proycon/orgs","repos_url":"https://api.github.com/users/proycon/repos","events_url":"https://api.github.com/users/proycon/events{/privacy}","received_events_url":"https://api.github.com/users/proycon/received_events","type":"User","site_admin":false},"assignees":[{"login":"proycon","id":75427,"avatar_url":"https://avatars.githubusercontent.com/u/75427?v=3","gravatar_id":"","url":"https://api.github.com/users/proycon","html_url":"https://github.com/proycon","followers_url":"https://api.github.com/users/proycon/followers","following_url":"https://api.github.com/users/proycon/following{/other_user}","gists_url":"https://api.github.com/users/proycon/gists{/gist_id}","starred_url":"https://api.github.com/users/proycon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proycon/subscriptions","organizations_url":"https://api.github.com/users/proycon/orgs","repos_url":"https://api.github.com/users/proycon/repos","events_url":"https://api.github.com/users/proycon/events{/privacy}","received_events_url":"https://api.github.com/users/proycon/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/proycon/flat/milestones/6","html_url":"https://github.com/proycon/flat/milestones/v0.6.1","labels_url":"https://api.github.com/repos/proycon/flat/milestones/6/labels","id":2068670,"number":6,"title":"v0.6.1","description":null,"creator":{"login":"proycon","id":75427,"avatar_url":"https://avatars.githubusercontent.com/u/75427?v=3","gravatar_id":"","url":"https://api.github.com/users/proycon","html_url":"https://github.com/proycon","followers_url":"https://api.github.com/users/proycon/followers","following_url":"https://api.github.com/users/proycon/following{/other_user}","gists_url":"https://api.github.com/users/proycon/gists{/gist_id}","starred_url":"https://api.github.com/users/proycon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proycon/subscriptions","organizations_url":"https://api.github.com/users/proycon/orgs","repos_url":"https://api.github.com/users/proycon/repos","events_url":"https://api.github.com/users/proycon/events{/privacy}","received_events_url":"https://api.github.com/users/proycon/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2016-10-13T19:34:04Z","updated_at":"2016-10-14T09:09:11Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-10-13T19:29:47Z","updated_at":"2016-10-14T09:09:11Z","closed_at":"2016-10-14T09:09:11Z","body":"consider this configuration in settings.py\r\n\r\nconfiguration: {\r\n   ...\r\n   'metadataindex': ['status'],\r\n   'metadataconstraints': {'status': [ \"untouched\", \"inprogress\", \"complete\"]}\r\n}\r\n\r\nIn metadata editor add key='status' and value='ok'\r\nclick on save changes\r\na dropdown menu will appear with 4 possible values: [ \"ok\", \"untouched\", \"inprogress\", \"complete\"]\r\nselect complete and save changes\r\n\r\nthe following error will pop up:\r\n\r\nIntegrityError at /metadata/federico.sangati/Pilot2_ST_English/\r\n\r\n(1062, \"Duplicate entry 'federico.sangati-Pilot2_ST_English-status' for key 'metadata_metadataindex_namespace_e37f343e_uniq'\")\r\n\r\nRequest Method: \tGET\r\nRequest URL: \thttp://mwe.phil.hhu.de/metadata/federico.sangati/Pilot2_ST_English/\r\nDjango Version: \t1.10.1\r\nException Type: \tIntegrityError\r\nException Value: \t\r\n\r\n(1062, \"Duplicate entry 'federico.sangati-Pilot2_ST_English-status' for key 'metadata_metadataindex_namespace_e37f343e_uniq'\")\r\n\r\nException Location: \t/usr/lib/python3/dist-packages/MySQLdb/connections.py in query, line 280\r\nPython Executable: \t/usr/bin/python3\r\nPython Version: \t3.4.2\r\nPython Path: \t\r\n\r\n['/usr/local/lib/python3.4/dist-packages/pip-8.1.2-py3.4.egg',\r\n '/usr/lib/python3.4',\r\n '/usr/lib/python3.4/plat-x86_64-linux-gnu',\r\n '/usr/lib/python3.4/lib-dynload',\r\n '/usr/local/lib/python3.4/dist-packages',\r\n '/usr/lib/python3/dist-packages',\r\n '/home/zadeh/settings']\r\n\r\nServer time: \tThu, 13 Oct 2016 21:29:07 +0200\r\n\r\nEnvironment:\r\n\r\n\r\nRequest Method: GET\r\nRequest URL: http://mwe.phil.hhu.de/metadata/federico.sangati/Pilot2_ST_English/\r\n\r\nDjango Version: 1.10.1\r\nPython Version: 3.4.2\r\nInstalled Applications:\r\n('django.contrib.auth',\r\n 'django.contrib.contenttypes',\r\n 'django.contrib.sessions',\r\n 'django.contrib.sites',\r\n 'django.contrib.messages',\r\n 'django.contrib.staticfiles',\r\n 'django.contrib.admin',\r\n 'flat.users',\r\n 'flat.modes.viewer',\r\n 'flat.modes.editor',\r\n 'flat.modes.structureeditor',\r\n 'flat.modes.metadata')\r\nInstalled Middleware:\r\n('django.middleware.common.CommonMiddleware',\r\n 'django.contrib.sessions.middleware.SessionMiddleware',\r\n 'django.middleware.csrf.CsrfViewMiddleware',\r\n 'django.contrib.auth.middleware.AuthenticationMiddleware',\r\n 'django.contrib.messages.middleware.MessageMiddleware')\r\n\r\n\r\n\r\nTraceback:\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/query.py\" in update_or_create\r\n  488.             obj = self.get(**lookup)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/query.py\" in get\r\n  385.                 self.model._meta.object_name\r\n\r\nDuring handling of the above exception (MetadataIndex matching query does not exist.), another exception occurred:\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/backends/utils.py\" in execute\r\n  64.                 return self.cursor.execute(sql, params)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/backends/mysql/base.py\" in execute\r\n  112.             return self.cursor.execute(query, args)\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/cursors.py\" in execute\r\n  226.             self.errorhandler(self, exc, value)\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/connections.py\" in defaulterrorhandler\r\n  36.         raise errorvalue\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/cursors.py\" in execute\r\n  217.             res = self._query(query)\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/cursors.py\" in _query\r\n  378.         rowcount = self._do_query(q)\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/cursors.py\" in _do_query\r\n  341.         db.query(q)\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/connections.py\" in query\r\n  280.             _mysql.connection.query(self, query)\r\n\r\nThe above exception ((1062, \"Duplicate entry 'federico.sangati-Pilot2_ST_English-status' for key 'metadata_metadataindex_namespace_e37f343e_uniq'\")) was the direct cause of the following exception:\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/core/handlers/exception.py\" in inner\r\n  39.             response = get_response(request)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/core/handlers/base.py\" in _legacy_get_response\r\n  249.             response = self._get_response(request)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/core/handlers/base.py\" in _get_response\r\n  187.                 response = self.process_exception_by_middleware(e, request)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/core/handlers/base.py\" in _get_response\r\n  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/contrib/auth/decorators.py\" in _wrapped_view\r\n  23.                 return view_func(request, *args, **kwargs)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/flat/modes/metadata/views.py\" in view\r\n  29.         return initdoc(request, namespace,docid, 'metadata', 'metadata.html')\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/flat/views.py\" in initdoc\r\n  143.                     MetadataIndex.objects.update_or_create(namespace=namespace,docid=docid, key=metakey,value=metadata[metakey])\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/manager.py\" in manager_method\r\n  85.                 return getattr(self.get_queryset(), name)(*args, **kwargs)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/query.py\" in update_or_create\r\n  490.             obj, created = self._create_object_from_params(lookup, params)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/query.py\" in _create_object_from_params\r\n  513.             six.reraise(*exc_info)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/utils/six.py\" in reraise\r\n  686.         raise value\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/query.py\" in _create_object_from_params\r\n  505.                 obj = self.create(**params)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/query.py\" in create\r\n  399.         obj.save(force_insert=True, using=self.db)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/base.py\" in save\r\n  796.                        force_update=force_update, update_fields=update_fields)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/base.py\" in save_base\r\n  824.             updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/base.py\" in _save_table\r\n  908.             result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/base.py\" in _do_insert\r\n  947.                                using=using, raw=raw)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/manager.py\" in manager_method\r\n  85.                 return getattr(self.get_queryset(), name)(*args, **kwargs)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/query.py\" in _insert\r\n  1045.         return query.get_compiler(using=using).execute_sql(return_id)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/models/sql/compiler.py\" in execute_sql\r\n  1054.                 cursor.execute(sql, params)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/backends/utils.py\" in execute\r\n  79.             return super(CursorDebugWrapper, self).execute(sql, params)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/backends/utils.py\" in execute\r\n  64.                 return self.cursor.execute(sql, params)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/utils.py\" in __exit__\r\n  94.                 six.reraise(dj_exc_type, dj_exc_value, traceback)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/utils/six.py\" in reraise\r\n  685.             raise value.with_traceback(tb)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/backends/utils.py\" in execute\r\n  64.                 return self.cursor.execute(sql, params)\r\n\r\nFile \"/usr/local/lib/python3.4/dist-packages/django/db/backends/mysql/base.py\" in execute\r\n  112.             return self.cursor.execute(query, args)\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/cursors.py\" in execute\r\n  226.             self.errorhandler(self, exc, value)\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/connections.py\" in defaulterrorhandler\r\n  36.         raise errorvalue\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/cursors.py\" in execute\r\n  217.             res = self._query(query)\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/cursors.py\" in _query\r\n  378.         rowcount = self._do_query(q)\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/cursors.py\" in _do_query\r\n  341.         db.query(q)\r\n\r\nFile \"/usr/lib/python3/dist-packages/MySQLdb/connections.py\" in query\r\n  280.             _mysql.connection.query(self, query)\r\n\r\nException Type: IntegrityError at /metadata/federico.sangati/Pilot2_ST_English/\r\nException Value: (1062, \"Duplicate entry 'federico.sangati-Pilot2_ST_English-status' for key 'metadata_metadataindex_namespace_e37f343e_uniq'\")\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/proycon/flat/issues/comments/253748265","html_url":"https://github.com/proycon/flat/issues/73#issuecomment-253748265","issue_url":"https://api.github.com/repos/proycon/flat/issues/73","id":253748265,"user":{"login":"proycon","id":75427,"avatar_url":"https://avatars.githubusercontent.com/u/75427?v=3","gravatar_id":"","url":"https://api.github.com/users/proycon","html_url":"https://github.com/proycon","followers_url":"https://api.github.com/users/proycon/followers","following_url":"https://api.github.com/users/proycon/following{/other_user}","gists_url":"https://api.github.com/users/proycon/gists{/gist_id}","starred_url":"https://api.github.com/users/proycon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proycon/subscriptions","organizations_url":"https://api.github.com/users/proycon/orgs","repos_url":"https://api.github.com/users/proycon/repos","events_url":"https://api.github.com/users/proycon/events{/privacy}","received_events_url":"https://api.github.com/users/proycon/received_events","type":"User","site_admin":false},"created_at":"2016-10-14T09:09:10Z","updated_at":"2016-10-14T09:09:10Z","body":"Fixed in v0.6.1"}}
{"actor":{"display_login":"proycon"}}