Normalize tags list on save issue and userstory.
parent
271f2ef6c7
commit
8ee3554720
|
@ -106,3 +106,8 @@ def issue_finished_date_handler(sender, instance, **kwargs):
|
||||||
def issue_ref_handler(sender, instance, **kwargs):
|
def issue_ref_handler(sender, instance, **kwargs):
|
||||||
if not instance.id and instance.project:
|
if not instance.id and instance.project:
|
||||||
instance.ref = ref_uniquely(instance.project, "last_issue_ref", instance.__class__)
|
instance.ref = ref_uniquely(instance.project, "last_issue_ref", instance.__class__)
|
||||||
|
|
||||||
|
@receiver(models.signals.pre_save, sender=Issue, dispatch_uid="issue-tags-normalization")
|
||||||
|
def issue_tags_normalization(sender, instance, **kwargs):
|
||||||
|
if isinstance(instance.tags, (list, tuple)):
|
||||||
|
instance.tags = list(map(lambda x: x.lower(), instance.tags))
|
||||||
|
|
|
@ -146,3 +146,8 @@ def us_create_role_points_handler(sender, instance, **kwargs):
|
||||||
def us_task_reassignation(sender, instance, created, **kwargs):
|
def us_task_reassignation(sender, instance, created, **kwargs):
|
||||||
if not created:
|
if not created:
|
||||||
instance.tasks.update(milestone=instance.milestone)
|
instance.tasks.update(milestone=instance.milestone)
|
||||||
|
|
||||||
|
@receiver(models.signals.pre_save, sender=UserStory, dispatch_uid="us-tags-normalization")
|
||||||
|
def us_tags_normalization(sender, instance, **kwargs):
|
||||||
|
if isinstance(instance.tags, (list, tuple)):
|
||||||
|
instance.tags = list(map(lambda x: x.lower(), instance.tags))
|
||||||
|
|
Loading…
Reference in New Issue