mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
append api call
This commit is contained in:
parent
f8ce23217e
commit
c9f0528dfc
@ -404,17 +404,19 @@ def DownloadFile(data, filename, content_type='application/text', inline=False):
|
||||
return response
|
||||
|
||||
|
||||
def extract_serial_numbers(serials, expected_quantity):
|
||||
def extract_serial_numbers(serials, expected_quantity, next_number: int):
|
||||
""" Attempt to extract serial numbers from an input string.
|
||||
- Serial numbers must be integer values
|
||||
- Serial numbers must be positive
|
||||
- Serial numbers can be split by whitespace / newline / commma chars
|
||||
- Serial numbers can be supplied as an inclusive range using hyphen char e.g. 10-20
|
||||
- Serial numbers can be defined as ~ for getting the next available serial number
|
||||
- Serial numbers can be supplied as <start>+ for getting all expecteded numbers starting from <start>
|
||||
- Serial numbers can be supplied as <start>+<length> for getting <length> numbers starting from <start>
|
||||
|
||||
Args:
|
||||
expected_quantity: The number of (unique) serial numbers we expect
|
||||
next_number(int): the next possible serial number
|
||||
"""
|
||||
|
||||
serials = serials.strip()
|
||||
|
Loading…
Reference in New Issue
Block a user