{"action":"created","issue":{"url":"https://api.github.com/repos/tonioo/modoboa/issues/747","labels_url":"https://api.github.com/repos/tonioo/modoboa/issues/747/labels{/name}","comments_url":"https://api.github.com/repos/tonioo/modoboa/issues/747/comments","events_url":"https://api.github.com/repos/tonioo/modoboa/issues/747/events","html_url":"https://github.com/tonioo/modoboa/issues/747","id":89764078,"number":747,"title":"Update 1.2.1 -> 1.3.3 issue: modoboa_amavis.models.DoesNotExist: Policy matching query does not exist","user":{"login":"mrh666","id":6307174,"avatar_url":"https://avatars.githubusercontent.com/u/6307174?v=3","gravatar_id":"","url":"https://api.github.com/users/mrh666","html_url":"https://github.com/mrh666","followers_url":"https://api.github.com/users/mrh666/followers","following_url":"https://api.github.com/users/mrh666/following{/other_user}","gists_url":"https://api.github.com/users/mrh666/gists{/gist_id}","starred_url":"https://api.github.com/users/mrh666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrh666/subscriptions","organizations_url":"https://api.github.com/users/mrh666/orgs","repos_url":"https://api.github.com/users/mrh666/repos","events_url":"https://api.github.com/users/mrh666/events{/privacy}","received_events_url":"https://api.github.com/users/mrh666/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-20T12:33:52Z","updated_at":"2015-07-18T13:23:16Z","closed_at":"2015-07-18T13:23:16Z","body":"Hi there,\r\n\r\nDuring the migration from 1.2.1 to 1.3.3 I deployed a new modoboa instance, added extensions, dbs and routers section to settings.py:\r\n\r\n```\r\nMODOBOA_APPS = (\r\n    'modoboa',\r\n    'modoboa.core',\r\n    'modoboa.lib',\r\n    # Modoboa extensions here.\r\n    'modoboa_admin',\r\n    'modoboa_admin_relaydomains',\r\n    'modoboa_admin_limits',\r\n    'modoboa_postfix_autoreply',\r\n    'modoboa_webmail',\r\n    'modoboa_stats',\r\n    'modoboa_sievefilters',\r\n    'modoboa_radicale',\r\n    'modoboa_amavis',\r\n)\r\n```\r\n\r\n```\r\nDATABASES = {\r\n    'default': {\r\n        'ENGINE': 'django.db.backends.mysql',\r\n        'NAME': 'modoboa',\r\n        'USER': 'USERNAME',\r\n        'PASSWORD': 'PASSWORD',\r\n        'HOST': 'localhost',\r\n        'PORT': '3306',\r\n        'ATOMIC_REQUESTS': True,\r\n        'OPTIONS' : {\r\n            \"init_command\" : 'SET foreign_key_checks = 0;',\r\n        },\r\n    },\r\n    'amavis': {\r\n       'ENGINE': 'django.db.backends.mysql',\r\n       'HOST': '',\r\n       'NAME': 'amavis',\r\n       'USER': 'USERNAME',\r\n       'PASSWORD': 'PASSWORD',\r\n    }\r\n}\r\n\r\nDATABASE_ROUTERS = [\"modoboa_amavis.dbrouter.AmavisRouter\"]\r\n```\r\n\r\nDuring migration process I run ```python manage.py load_initial_data``` and I've got the next error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"manage.py\", line 10, in <module>\r\n    execute_from_command_line(sys.argv)\r\n  File \"/usr/lib64/python2.7/site-packages/django/core/management/__init__.py\", line 385, in execute_from_command_line\r\n    utility.execute()\r\n  File \"/usr/lib64/python2.7/site-packages/django/core/management/__init__.py\", line 377, in execute\r\n    self.fetch_command(subcommand).run_from_argv(self.argv)\r\n  File \"/usr/lib64/python2.7/site-packages/django/core/management/base.py\", line 288, in run_from_argv\r\n    self.execute(*args, **options.__dict__)\r\n  File \"/usr/lib64/python2.7/site-packages/django/core/management/base.py\", line 338, in execute\r\n    output = self.handle(*args, **options)\r\n  File \"/usr/lib/python2.7/site-packages/modoboa/core/management/commands/load_initial_data.py\", line 55, in handle\r\n    extension.load_initial_data()\r\n  File \"/usr/lib/python2.7/site-packages/modoboa_amavis/modo_extension.py\", line 43, in load_initial_data\r\n    policy = create_user_and_policy(\"@{0}\".format(dom.name))\r\n  File \"/usr/lib/python2.7/site-packages/modoboa_amavis/lib.py\", line 242, in create_user_and_policy\r\n    return Policy.objects.get(policy_name=name[:32])\r\n  File \"/usr/lib64/python2.7/site-packages/django/db/models/manager.py\", line 92, in manager_method\r\n    return getattr(self.get_queryset(), name)(*args, **kwargs)\r\n  File \"/usr/lib64/python2.7/site-packages/django/db/models/query.py\", line 357, in get\r\n    self.model._meta.object_name)\r\nmodoboa_amavis.models.DoesNotExist: Policy matching query does not exist.\r\n```\r\n\r\nHow can I fix it?\r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/tonioo/modoboa/issues/comments/122543524","html_url":"https://github.com/tonioo/modoboa/issues/747#issuecomment-122543524","issue_url":"https://api.github.com/repos/tonioo/modoboa/issues/747","id":122543524,"user":{"login":"tonioo","id":531694,"avatar_url":"https://avatars.githubusercontent.com/u/531694?v=3","gravatar_id":"","url":"https://api.github.com/users/tonioo","html_url":"https://github.com/tonioo","followers_url":"https://api.github.com/users/tonioo/followers","following_url":"https://api.github.com/users/tonioo/following{/other_user}","gists_url":"https://api.github.com/users/tonioo/gists{/gist_id}","starred_url":"https://api.github.com/users/tonioo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonioo/subscriptions","organizations_url":"https://api.github.com/users/tonioo/orgs","repos_url":"https://api.github.com/users/tonioo/repos","events_url":"https://api.github.com/users/tonioo/events{/privacy}","received_events_url":"https://api.github.com/users/tonioo/received_events","type":"User","site_admin":false},"created_at":"2015-07-18T13:23:15Z","updated_at":"2015-07-18T13:23:15Z","body":"This issue was moved to modoboa/modoboa-amavis#19"}}