We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Stale import db issue
PO says the last import was at `<yml_catalog date="2019-05-23 00:38">`
Check if import db can autolaunch.

Import db is called as catalog update command


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `shopelectro/management/commands/_update_catalog/update_pack.py`
Content:
```
1 """
2 Update Product.in_pack and prices.
3 
4 The update_catalog command always resets product prices to per unit format, so:
5 1. Parse in pack quantity from Tag.name and save it to Product.in_pack
6 2. Multiply product prices by in_pack value and save.
7 """
8 import logging
9 
10 from django.db import models, transaction
11 
12 from shopelectro.models import TagQuerySet, TagGroup
13 
14 logger = logging.getLogger(__name__)
15 PRICES = ['price', 'purchase_price', 'wholesale_small', 'wholesale_medium', 'wholesale_large']
16 
17 
18 def update_in_packs(packs: TagQuerySet):
19     """Parse and save in pack quantity values."""
20     # @todo #859:60m Implement update_pack and render prices properly.
21 
22 
23 def update_prices(packs: TagQuerySet):
24     """Multiply product prices on in pack quantity."""
25     fields_to_update = {}
26     for price in PRICES:
27         fields_to_update[price] = models.F(price) * models.F('in_pack')
28 
29     with transaction.atomic():
30         packs.products().update(**fields_to_update)
31 
32 
33 def main(*args, kwargs):
34     uuid = 'ae30f766-0bb8-11e6-80ea-02d2cc20e118'
35     pack_group = TagGroup.objects.filter(uuid=uuid).first()
36     if not pack_group:
37         logger.error(f'Couldn\'t find "Упаковка" tag group with uuid = "{uuid}".')
38         return
39 
40     return
41 
42     packs = pack_group.tags.all().prefetch_related('products')
43     update_in_packs(packs)
44     update_prices(packs)
45
```
--- 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/shopelectro/management/commands/_update_catalog/update_pack.py b/shopelectro/management/commands/_update_catalog/update_pack.py
--- a/shopelectro/management/commands/_update_catalog/update_pack.py
+++ b/shopelectro/management/commands/_update_catalog/update_pack.py
@@ -30,7 +30,7 @@
         packs.products().update(**fields_to_update)
 
 
-def main(*args, kwargs):
+def main(*args, **kwargs):
     uuid = 'ae30f766-0bb8-11e6-80ea-02d2cc20e118'
     pack_group = TagGroup.objects.filter(uuid=uuid).first()
     if not pack_group:

{"golden_diff": "diff --git a/shopelectro/management/commands/_update_catalog/update_pack.py b/shopelectro/management/commands/_update_catalog/update_pack.py\n--- a/shopelectro/management/commands/_update_catalog/update_pack.py\n+++ b/shopelectro/management/commands/_update_catalog/update_pack.py\n@@ -30,7 +30,7 @@\n         packs.products().update(**fields_to_update)\n \n \n-def main(*args, kwargs):\n+def main(*args, **kwargs):\n     uuid = 'ae30f766-0bb8-11e6-80ea-02d2cc20e118'\n     pack_group = TagGroup.objects.filter(uuid=uuid).first()\n     if not pack_group:\n", "issue": "Stale import db issue\nPO says the last import was at `<yml_catalog date=\"2019-05-23 00:38\">`\r\nCheck if import db can autolaunch.\r\n\r\nImport db is called as catalog update command\r\n\n", "before_files": [{"content": "\"\"\"\nUpdate Product.in_pack and prices.\n\nThe update_catalog command always resets product prices to per unit format, so:\n1. Parse in pack quantity from Tag.name and save it to Product.in_pack\n2. Multiply product prices by in_pack value and save.\n\"\"\"\nimport logging\n\nfrom django.db import models, transaction\n\nfrom shopelectro.models import TagQuerySet, TagGroup\n\nlogger = logging.getLogger(__name__)\nPRICES = ['price', 'purchase_price', 'wholesale_small', 'wholesale_medium', 'wholesale_large']\n\n\ndef update_in_packs(packs: TagQuerySet):\n    \"\"\"Parse and save in pack quantity values.\"\"\"\n    # @todo #859:60m Implement update_pack and render prices properly.\n\n\ndef update_prices(packs: TagQuerySet):\n    \"\"\"Multiply product prices on in pack quantity.\"\"\"\n    fields_to_update = {}\n    for price in PRICES:\n        fields_to_update[price] = models.F(price) * models.F('in_pack')\n\n    with transaction.atomic():\n        packs.products().update(**fields_to_update)\n\n\ndef main(*args, kwargs):\n    uuid = 'ae30f766-0bb8-11e6-80ea-02d2cc20e118'\n    pack_group = TagGroup.objects.filter(uuid=uuid).first()\n    if not pack_group:\n        logger.error(f'Couldn\\'t find \"\u0423\u043f\u0430\u043a\u043e\u0432\u043a\u0430\" tag group with uuid = \"{uuid}\".')\n        return\n\n    return\n\n    packs = pack_group.tags.all().prefetch_related('products')\n    update_in_packs(packs)\n    update_prices(packs)\n", "path": "shopelectro/management/commands/_update_catalog/update_pack.py"}], "after_files": [{"content": "\"\"\"\nUpdate Product.in_pack and prices.\n\nThe update_catalog command always resets product prices to per unit format, so:\n1. Parse in pack quantity from Tag.name and save it to Product.in_pack\n2. Multiply product prices by in_pack value and save.\n\"\"\"\nimport logging\n\nfrom django.db import models, transaction\n\nfrom shopelectro.models import TagQuerySet, TagGroup\n\nlogger = logging.getLogger(__name__)\nPRICES = ['price', 'purchase_price', 'wholesale_small', 'wholesale_medium', 'wholesale_large']\n\n\ndef update_in_packs(packs: TagQuerySet):\n    \"\"\"Parse and save in pack quantity values.\"\"\"\n    # @todo #859:60m Implement update_pack and render prices properly.\n\n\ndef update_prices(packs: TagQuerySet):\n    \"\"\"Multiply product prices on in pack quantity.\"\"\"\n    fields_to_update = {}\n    for price in PRICES:\n        fields_to_update[price] = models.F(price) * models.F('in_pack')\n\n    with transaction.atomic():\n        packs.products().update(**fields_to_update)\n\n\ndef main(*args, **kwargs):\n    uuid = 'ae30f766-0bb8-11e6-80ea-02d2cc20e118'\n    pack_group = TagGroup.objects.filter(uuid=uuid).first()\n    if not pack_group:\n        logger.error(f'Couldn\\'t find \"\u0423\u043f\u0430\u043a\u043e\u0432\u043a\u0430\" tag group with uuid = \"{uuid}\".')\n        return\n\n    return\n\n    packs = pack_group.tags.all().prefetch_related('products')\n    update_in_packs(packs)\n    update_prices(packs)\n", "path": "shopelectro/management/commands/_update_catalog/update_pack.py"}]}