2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

upgrade to pyhton 3.9 syntax

using pyupgrade
This commit is contained in:
Matthias
2022-05-01 21:53:12 +02:00
parent b59a4d53f0
commit d05472b30c
11 changed files with 16 additions and 18 deletions

View File

@ -78,7 +78,7 @@ def update_history(apps, schema_editor):
tracking_type = StockHistoryCode.STOCK_REMOVE
# Extract the number of removed items
result = re.search("^removed ([\d\.]+) items", title)
result = re.search(r"^removed ([\d\.]+) items", title)
if result:
@ -102,7 +102,7 @@ def update_history(apps, schema_editor):
elif 'moved to' in title:
tracking_type = StockHistoryCode.STOCK_MOVE
result = re.search('^Moved to (.*)( - )*(.*) \(from.*$', entry.title)
result = re.search(r'^Moved to (.*)( - )*(.*) \(from.*$', entry.title)
if result:
# Legacy tracking entries recorded the location in multiple ways, because.. why not?
@ -157,7 +157,7 @@ def update_history(apps, schema_editor):
tracking_type = StockHistoryCode.STOCK_ADD
# Extract the number of added items
result = re.search("^added ([\d\.]+) items", title)
result = re.search(r"^added ([\d\.]+) items", title)
if result: