Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Jul 16, 2023
1 parent 5967501 commit 31ac6c6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions inventree/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,21 @@ def printlabel(self, label, plugin=None, destination=None, *args, **kwargs):

# Label file is availble for download
if download_url and destination is not None:
if os.path.exists(destination) and os.path.isdir(destination):
# No file name given, construct one
# Otherwise, filename will be something like '?parts[]=37'
destination = os.path.join(
destination,
f'Label_{self.LABELNAME}{label}_{self.pk}.pdf'
)
if os.path.exists(destination) and os.path.isdir(destination):
# No file name given, construct one
# Otherwise, filename will be something like '?parts[]=37'
destination = os.path.join(
destination,
f'Label_{self.LABELNAME}{label}_{self.pk}.pdf'
)

# Use downloadFile method to get the file
return self._api.downloadFile(url=f'api/{URL}', destination=destination, params=params, *args, **kwargs)
# Use downloadFile method to get the file
return self._api.downloadFile(url=f'api/{URL}', destination=destination, params=params, *args, **kwargs)

else:
return response


class LabelLocation(inventree.base.MetadataMixin, inventree.base.InventreeObject):
""" Class representing the Label/Location database model """

Expand Down

0 comments on commit 31ac6c6

Please sign in to comment.