mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
tags from folders: case insensitive
This commit is contained in:
parent
74a99cf330
commit
0a0d462938
@ -29,7 +29,9 @@ def _tags_from_path(filepath):
|
|||||||
path_parts = Path(filepath).relative_to(
|
path_parts = Path(filepath).relative_to(
|
||||||
settings.CONSUMPTION_DIR).parent.parts
|
settings.CONSUMPTION_DIR).parent.parts
|
||||||
for part in path_parts:
|
for part in path_parts:
|
||||||
tag_ids.add(Tag.objects.get_or_create(name=part)[0].pk)
|
tag_ids.add(Tag.objects.get_or_create(name__iexact=part, defaults={
|
||||||
|
"name": part
|
||||||
|
})[0].pk)
|
||||||
|
|
||||||
return tag_ids
|
return tag_ids
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ class TestConsumerTags(DirectoriesMixin, ConsumerMixin, TransactionTestCase):
|
|||||||
|
|
||||||
tag_names = ("existingTag", "Space Tag")
|
tag_names = ("existingTag", "Space Tag")
|
||||||
# Create a Tag prior to consuming a file using it in path
|
# Create a Tag prior to consuming a file using it in path
|
||||||
tag_ids = [Tag.objects.create(name=tag_names[0]).pk,]
|
tag_ids = [Tag.objects.create(name="existingtag").pk,]
|
||||||
|
|
||||||
self.t_start()
|
self.t_start()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user