mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-11 15:34:15 +00:00
refactor: remove blank lines after docstring (#5736)
There shouldn't be any blank lines after the function docstring. Remove the blank lines to fix this issue. Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
@ -30,12 +30,10 @@ class InvenTreeInternalBarcodePlugin(BarcodeMixin, InvenTreePlugin):
|
||||
@staticmethod
|
||||
def get_supported_barcode_models():
|
||||
"""Returns a list of database models which support barcode functionality"""
|
||||
|
||||
return getModelsWithMixin(InvenTreeBarcodeMixin)
|
||||
|
||||
def format_matched_response(self, label, model, instance):
|
||||
"""Format a response for the scanned data"""
|
||||
|
||||
data = {
|
||||
'pk': instance.pk
|
||||
}
|
||||
@ -65,7 +63,6 @@ class InvenTreeInternalBarcodePlugin(BarcodeMixin, InvenTreePlugin):
|
||||
|
||||
Here we are looking for a dict object which contains a reference to a particular InvenTree database object
|
||||
"""
|
||||
|
||||
# Create hash from raw barcode data
|
||||
barcode_hash = hash_barcode(barcode_data)
|
||||
|
||||
|
@ -45,7 +45,6 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase):
|
||||
|
||||
def assign(self, data, expected_code=None):
|
||||
"""Perform a 'barcode assign' request"""
|
||||
|
||||
return self.post(
|
||||
reverse('api-barcode-link'),
|
||||
data=data,
|
||||
@ -54,7 +53,6 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase):
|
||||
|
||||
def unassign(self, data, expected_code=None):
|
||||
"""Perform a 'barcode unassign' request"""
|
||||
|
||||
return self.post(
|
||||
reverse('api-barcode-unlink'),
|
||||
data=data,
|
||||
@ -63,7 +61,6 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase):
|
||||
|
||||
def scan(self, data, expected_code=None):
|
||||
"""Perform a 'scan' operation"""
|
||||
|
||||
return self.post(
|
||||
reverse('api-barcode-scan'),
|
||||
data=data,
|
||||
@ -72,7 +69,6 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase):
|
||||
|
||||
def test_unassign_errors(self):
|
||||
"""Test various error conditions for the barcode unassign endpoint"""
|
||||
|
||||
# Fail without any fields provided
|
||||
response = self.unassign(
|
||||
{},
|
||||
@ -114,7 +110,6 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase):
|
||||
|
||||
def test_assign_to_stock_item(self):
|
||||
"""Test that we can assign a unique barcode to a StockItem object"""
|
||||
|
||||
# Test without providing any fields
|
||||
response = self.assign(
|
||||
{
|
||||
@ -198,7 +193,6 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase):
|
||||
|
||||
def test_assign_to_part(self):
|
||||
"""Test that we can assign a unique barcode to a Part instance"""
|
||||
|
||||
barcode = 'xyz-123'
|
||||
|
||||
self.assignRole('part.change')
|
||||
@ -281,7 +275,6 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase):
|
||||
|
||||
def test_assign_to_location(self):
|
||||
"""Test that we can assign a unique barcode to a StockLocation instance"""
|
||||
|
||||
barcode = '555555555555555555555555'
|
||||
|
||||
# Assign random barcode data to a StockLocation instance
|
||||
@ -338,7 +331,6 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase):
|
||||
|
||||
def test_scan_third_party(self):
|
||||
"""Test scanning of third-party barcodes"""
|
||||
|
||||
# First scanned barcode is for a 'third-party' barcode (which does not exist)
|
||||
response = self.scan({'barcode': 'blbla=10008'}, expected_code=400)
|
||||
self.assertEqual(response.data['error'], 'No match found for barcode data')
|
||||
@ -367,7 +359,6 @@ class TestInvenTreeBarcode(InvenTreeAPITestCase):
|
||||
|
||||
def test_scan_inventree(self):
|
||||
"""Test scanning of first-party barcodes"""
|
||||
|
||||
# Scan a StockItem object (which does not exist)
|
||||
response = self.scan(
|
||||
{
|
||||
|
@ -133,7 +133,6 @@ class InvenTreeCoreNotificationsPlugin(SettingsContentMixin, SettingsMixin, Inve
|
||||
|
||||
def send_bulk(self):
|
||||
"""Send the notifications out via slack."""
|
||||
|
||||
instance = registry.plugins.get(self.get_plugin().NAME.lower())
|
||||
url = instance.get_setting('NOTIFICATION_SLACK_URL')
|
||||
|
||||
|
@ -26,7 +26,6 @@ class InvenTreeCurrencyExchange(APICallMixin, CurrencyExchangeMixin, InvenTreePl
|
||||
|
||||
def update_exchange_rates(self, base_currency: str, symbols: list[str]) -> dict:
|
||||
"""Request exchange rate data from external API"""
|
||||
|
||||
response = self.api_call(
|
||||
'latest',
|
||||
url_args={
|
||||
|
@ -39,7 +39,6 @@ class InvenTreeLabelPlugin(LabelPrintingMixin, SettingsMixin, InvenTreePlugin):
|
||||
- Label outputs are concatenated together, and we return a single PDF file.
|
||||
- If DEBUG mode is enabled, we return a single HTML file.
|
||||
"""
|
||||
|
||||
debug = self.get_setting('DEBUG')
|
||||
|
||||
outputs = []
|
||||
@ -87,7 +86,6 @@ class InvenTreeLabelPlugin(LabelPrintingMixin, SettingsMixin, InvenTreePlugin):
|
||||
|
||||
Returns either a PDF or HTML output, depending on the DEBUG setting.
|
||||
"""
|
||||
|
||||
debug = kwargs.get('debug', self.get_setting('DEBUG'))
|
||||
|
||||
if debug:
|
||||
|
Reference in New Issue
Block a user