Skip to content

Commit c37283f

Browse files
Fix broken URLs
1 parent de44ebd commit c37283f

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

inventree/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ def scanBarcode(self, barcode_data):
623623
barcode_data = json.dumps(barcode_data)
624624

625625
response = self.post(
626-
'/barcode/',
626+
'barcode/',
627627
{
628628
'barcode': str(barcode_data),
629629
}

inventree/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ class MetadataMixin:
549549
- The 'metadata' is not used for any InvenTree business logic
550550
- Instead it can be used by plugins for storing arbitrary information
551551
- Internally it is stored as a JSON database field
552-
- Metadata is accessed via the API by appending '/metadata/' to the API URL
552+
- Metadata is accessed via the API by appending './metadata/' to the API URL
553553
554554
Note: Requires server API version 49 or newer
555555
@@ -724,7 +724,7 @@ def assignBarcode(self, barcode_data: str, reload=True):
724724
model_type = self.barcodeModelType()
725725

726726
response = self._api.post(
727-
'/barcode/link/',
727+
'barcode/link/',
728728
{
729729
'barcode': barcode_data,
730730
model_type: self.pk,
@@ -736,13 +736,13 @@ def assignBarcode(self, barcode_data: str, reload=True):
736736

737737
return response
738738

739-
def unassignBarcode(self, reload=True):
739+
def unassignBarcode(self, reload: bool = True):
740740
"""Unassign a barcode from this object"""
741741

742742
model_type = self.barcodeModelType()
743743

744744
response = self._api.post(
745-
'/barcode/unlink/',
745+
'barcode/unlink/',
746746
{
747747
model_type: self.pk,
748748
}

inventree/label.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def saveOutput(self, output, filename):
3939
def printLabel(self, template, plugin=None, destination=None, *args, **kwargs):
4040
"""Print a label against the provided label template."""
4141

42-
print_url = '/label/print/'
42+
print_url = 'label/print/'
4343

4444
template_id = self.getTemplateId(template)
4545

inventree/report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def printReport(self, report, destination=None, *args, **kwargs):
2929
If neither plugin nor destination is given, nothing will be done
3030
"""
3131

32-
print_url = '/report/print/'
32+
print_url = 'report/print/'
3333
template_id = self.getTemplateId(report)
3434

3535
response = self._api.post(

test/test_stock.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ def test_serialized(self):
267267
self.assertEqual('1006', items[1].serial)
268268
self.assertEqual('1007', items[2].serial)
269269

270+
# Delete the items after the test
271+
for item in items:
272+
item.delete()
270273

271274
class StockAdjustTest(InvenTreeTestCase):
272275
"""Unit tests for stock 'adjustment' actions"""

0 commit comments

Comments
 (0)