We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
`sync_stores` doesn't handle disabled projects
We addressed the similar issue for `update_stores` #4198.
`sync_stores` should work for disabled projects as well https://github.com/translate/pootle/issues/4198#issuecomment-161717337.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pootle/apps/pootle_app/management/commands/sync_stores.py`
Content:
```
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 #
4 # Copyright (C) Pootle contributors.
5 #
6 # This file is a part of the Pootle project. It is distributed under the GPL3
7 # or later license. See the LICENSE file for a copy of the license and the
8 # AUTHORS file for copyright and authorship information.
9 
10 import os
11 os.environ['DJANGO_SETTINGS_MODULE'] = 'pootle.settings'
12 from optparse import make_option
13 
14 from pootle_app.management.commands import PootleCommand
15 
16 
17 class Command(PootleCommand):
18     option_list = PootleCommand.option_list + (
19         make_option(
20             '--overwrite',
21             action='store_true',
22             dest='overwrite',
23             default=False,
24             help="Don't just save translations, but "
25                  "overwrite files to reflect state in database",
26         ),
27         make_option(
28             '--skip-missing',
29             action='store_true',
30             dest='skip_missing',
31             default=False,
32             help="Ignore missing files on disk",
33         ),
34         make_option(
35             '--force',
36             action='store_true',
37             dest='force',
38             default=False,
39             help="Don't ignore stores synced after last change",
40         ),
41     )
42     help = "Save new translations to disk manually."
43 
44     def handle_all_stores(self, translation_project, **options):
45         translation_project.sync(
46             conservative=not options['overwrite'],
47             skip_missing=options['skip_missing'],
48             only_newer=not options['force']
49         )
50 
51     def handle_store(self, store, **options):
52         store.sync(
53             conservative=not options['overwrite'],
54             update_structure=options['overwrite'],
55             skip_missing=options['skip_missing'],
56             only_newer=not options['force']
57         )
58
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pootle/apps/pootle_app/management/commands/sync_stores.py b/pootle/apps/pootle_app/management/commands/sync_stores.py
--- a/pootle/apps/pootle_app/management/commands/sync_stores.py
+++ b/pootle/apps/pootle_app/management/commands/sync_stores.py
@@ -40,13 +40,15 @@
         ),
     )
     help = "Save new translations to disk manually."
+    process_disabled_projects = True
 
     def handle_all_stores(self, translation_project, **options):
-        translation_project.sync(
-            conservative=not options['overwrite'],
-            skip_missing=options['skip_missing'],
-            only_newer=not options['force']
-        )
+        if translation_project.directory_exists_on_disk():
+            translation_project.sync(
+                conservative=not options['overwrite'],
+                skip_missing=options['skip_missing'],
+                only_newer=not options['force']
+            )
 
     def handle_store(self, store, **options):
         store.sync(

{"golden_diff": "diff --git a/pootle/apps/pootle_app/management/commands/sync_stores.py b/pootle/apps/pootle_app/management/commands/sync_stores.py\n--- a/pootle/apps/pootle_app/management/commands/sync_stores.py\n+++ b/pootle/apps/pootle_app/management/commands/sync_stores.py\n@@ -40,13 +40,15 @@\n         ),\n     )\n     help = \"Save new translations to disk manually.\"\n+    process_disabled_projects = True\n \n     def handle_all_stores(self, translation_project, **options):\n-        translation_project.sync(\n-            conservative=not options['overwrite'],\n-            skip_missing=options['skip_missing'],\n-            only_newer=not options['force']\n-        )\n+        if translation_project.directory_exists_on_disk():\n+            translation_project.sync(\n+                conservative=not options['overwrite'],\n+                skip_missing=options['skip_missing'],\n+                only_newer=not options['force']\n+            )\n \n     def handle_store(self, store, **options):\n         store.sync(\n", "issue": "`sync_stores` doesn't handle disabled projects\nWe addressed the similar issue for `update_stores` #4198.\n`sync_stores` should work for disabled projects as well https://github.com/translate/pootle/issues/4198#issuecomment-161717337.\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nimport os\nos.environ['DJANGO_SETTINGS_MODULE'] = 'pootle.settings'\nfrom optparse import make_option\n\nfrom pootle_app.management.commands import PootleCommand\n\n\nclass Command(PootleCommand):\n    option_list = PootleCommand.option_list + (\n        make_option(\n            '--overwrite',\n            action='store_true',\n            dest='overwrite',\n            default=False,\n            help=\"Don't just save translations, but \"\n                 \"overwrite files to reflect state in database\",\n        ),\n        make_option(\n            '--skip-missing',\n            action='store_true',\n            dest='skip_missing',\n            default=False,\n            help=\"Ignore missing files on disk\",\n        ),\n        make_option(\n            '--force',\n            action='store_true',\n            dest='force',\n            default=False,\n            help=\"Don't ignore stores synced after last change\",\n        ),\n    )\n    help = \"Save new translations to disk manually.\"\n\n    def handle_all_stores(self, translation_project, **options):\n        translation_project.sync(\n            conservative=not options['overwrite'],\n            skip_missing=options['skip_missing'],\n            only_newer=not options['force']\n        )\n\n    def handle_store(self, store, **options):\n        store.sync(\n            conservative=not options['overwrite'],\n            update_structure=options['overwrite'],\n            skip_missing=options['skip_missing'],\n            only_newer=not options['force']\n        )\n", "path": "pootle/apps/pootle_app/management/commands/sync_stores.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nimport os\nos.environ['DJANGO_SETTINGS_MODULE'] = 'pootle.settings'\nfrom optparse import make_option\n\nfrom pootle_app.management.commands import PootleCommand\n\n\nclass Command(PootleCommand):\n    option_list = PootleCommand.option_list + (\n        make_option(\n            '--overwrite',\n            action='store_true',\n            dest='overwrite',\n            default=False,\n            help=\"Don't just save translations, but \"\n                 \"overwrite files to reflect state in database\",\n        ),\n        make_option(\n            '--skip-missing',\n            action='store_true',\n            dest='skip_missing',\n            default=False,\n            help=\"Ignore missing files on disk\",\n        ),\n        make_option(\n            '--force',\n            action='store_true',\n            dest='force',\n            default=False,\n            help=\"Don't ignore stores synced after last change\",\n        ),\n    )\n    help = \"Save new translations to disk manually.\"\n    process_disabled_projects = True\n\n    def handle_all_stores(self, translation_project, **options):\n        if translation_project.directory_exists_on_disk():\n            translation_project.sync(\n                conservative=not options['overwrite'],\n                skip_missing=options['skip_missing'],\n                only_newer=not options['force']\n            )\n\n    def handle_store(self, store, **options):\n        store.sync(\n            conservative=not options['overwrite'],\n            update_structure=options['overwrite'],\n            skip_missing=options['skip_missing'],\n            only_newer=not options['force']\n        )\n", "path": "pootle/apps/pootle_app/management/commands/sync_stores.py"}]}