Skip to content

Commit

Permalink
use SUBDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
matmair committed Feb 27, 2024
1 parent 7083c1d commit b109f0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion InvenTree/generic/templating/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def ready(self):

def create_template_dir(self, model, data):
"""Create folder and database entries for the default templates, if they do not already exist."""
ref_name = getattr(model, 'SUBDIR', None) or model.getSubdir()
ref_name = model.getSubdir()

# Create root dir for templates
src_dir = self.get_src_dir(ref_name)
Expand Down
7 changes: 6 additions & 1 deletion InvenTree/label/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,13 @@ class Meta:

abstract = True

@classmethod
def getSubdir(cls) -> str:
"""Return the subdirectory for this label."""
return cls.SUBDIR

# Each class of label files will be stored in a separate subdirectory
SUBDIR = 'label'
SUBDIR: str = 'label'

# Object we will be printing against (will be filled out later)
object_to_print = None
Expand Down

0 comments on commit b109f0c

Please sign in to comment.