diff --git a/rdmo/projects/managers.py b/rdmo/projects/managers.py index e2dd1b1bd..defe80703 100644 --- a/rdmo/projects/managers.py +++ b/rdmo/projects/managers.py @@ -168,14 +168,14 @@ def filter_set(self, set_value): if element.attribute == set_value.attribute: attributes.update([descendant.attribute for descendant in element.descendants]) - # construct the set_prefix for decendants for this set - decendants_set_prefix = \ + # construct the set_prefix for descendants for this set + descendants_set_prefix = \ f'{set_value.set_prefix}|{set_value.set_index}' if set_value.set_prefix else str(set_value.set_index) - # collect all values for this set and all decendants + # collect all values for this set and all descendants return self.filter(attribute__in=attributes).filter( Q(set_prefix=set_value.set_prefix, set_index=set_value.set_index) | - Q(set_prefix__startswith=decendants_set_prefix) + Q(set_prefix__startswith=descendants_set_prefix) ) diff --git a/rdmo/projects/viewsets.py b/rdmo/projects/viewsets.py index b416347b0..cee88a84d 100644 --- a/rdmo/projects/viewsets.py +++ b/rdmo/projects/viewsets.py @@ -1,7 +1,7 @@ from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ObjectDoesNotExist -from django.db.models import OuterRef, Prefetch, Q, Subquery +from django.db.models import OuterRef, Prefetch, Subquery from django.db.models.functions import Coalesce, Greatest from django.http import Http404, HttpResponseRedirect from django.utils.translation import gettext_lazy as _ @@ -512,7 +512,7 @@ def copy_set(self, request, parent_lookup_project, pk=None): # for this value and the same set_prefix and set_index currentValue = self.get_object() - # collect all values for this set and all decendants + # collect all values for this set and all descendants currentValues = self.get_queryset().filter_set(currentValue) # de-serialize the posted new set value and save it, use the ValueSerializer