From 1e268c145768b0ab43d57f44b0cacd3cf8f6f7e1 Mon Sep 17 00:00:00 2001 From: Jochen Klar Date: Sun, 25 Aug 2024 14:10:17 +0200 Subject: [PATCH] Fix typos --- .../interview/components/main/question/QuestionError.js | 2 +- rdmo/projects/assets/js/interview/utils/options.js | 2 +- rdmo/projects/assets/js/interview/utils/page.js | 8 ++++---- .../templates/projects/project_interview_error.html | 2 +- rdmo/projects/viewsets.py | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rdmo/projects/assets/js/interview/components/main/question/QuestionError.js b/rdmo/projects/assets/js/interview/components/main/question/QuestionError.js index 85f2233e28..a575f40845 100644 --- a/rdmo/projects/assets/js/interview/components/main/question/QuestionError.js +++ b/rdmo/projects/assets/js/interview/components/main/question/QuestionError.js @@ -20,7 +20,7 @@ const getMessage = (error) => { return error.errors.api } } else { - return gettext('An unknown error occured, please contact support') + return gettext('An unknown error occurred, please contact support') } } diff --git a/rdmo/projects/assets/js/interview/utils/options.js b/rdmo/projects/assets/js/interview/utils/options.js index cf36e58136..35b949e617 100644 --- a/rdmo/projects/assets/js/interview/utils/options.js +++ b/rdmo/projects/assets/js/interview/utils/options.js @@ -36,7 +36,7 @@ const getValueOption = (options, value) => { } else if (!isEmpty(value.external_id)) { // this is a value with an external id from a provider if (isEmpty(options)) { - // if an external id is set but no options are retrived yet, we fake an option with + // if an external id is set but no options are retrieved yet, we fake an option with // the stored value, so that it is displayed before the input is opened return { id: value.external_id, diff --git a/rdmo/projects/assets/js/interview/utils/page.js b/rdmo/projects/assets/js/interview/utils/page.js index fe8e1d9318..f1d40c39ae 100644 --- a/rdmo/projects/assets/js/interview/utils/page.js +++ b/rdmo/projects/assets/js/interview/utils/page.js @@ -17,7 +17,7 @@ const initQuestionSet = (questionset) => { } }) - // aggregate questionsets from decendants + // aggregate questionsets from descendants questionset.questionsets = questionset.elements.reduce((questionsets, element) => { if (element.model == 'questions.questionset') { return questionsets.concat(element.questionsets) @@ -26,7 +26,7 @@ const initQuestionSet = (questionset) => { } }, []) - // aggregate optionsets from decendants + // aggregate optionsets from descendants questionset.questions = questionset.elements.reduce((questions, element) => { if (element.model == 'questions.questionset') { return questions.concat(element.questions) @@ -35,7 +35,7 @@ const initQuestionSet = (questionset) => { } }, []) - // aggregate optionsets from decendants + // aggregate optionsets from descendants questionset.optionsets = questionset.elements.reduce((optionsets, element) => { if (element.model == 'questions.questionset') { return optionsets.concat(element.optionsets) @@ -44,7 +44,7 @@ const initQuestionSet = (questionset) => { } }, []) - // aggregate attributes from decendants + // aggregate attributes from descendants questionset.attributes = questionset.elements.reduce((attributes, element) => { if (element.model == 'questions.questionset') { return attributes.concat(element.attributes) diff --git a/rdmo/projects/templates/projects/project_interview_error.html b/rdmo/projects/templates/projects/project_interview_error.html index 8c7b61a1b1..740a18d4b1 100644 --- a/rdmo/projects/templates/projects/project_interview_error.html +++ b/rdmo/projects/templates/projects/project_interview_error.html @@ -6,5 +6,5 @@

- {% trans 'An error occurred while retrieving the questionaire. Please contact support if this problem persists.' %} + {% trans 'An error occurred while retrieving the questionnaire. Please contact support if this problem persists.' %}

diff --git a/rdmo/projects/viewsets.py b/rdmo/projects/viewsets.py index a423f4cafd..3f8f51d7c3 100644 --- a/rdmo/projects/viewsets.py +++ b/rdmo/projects/viewsets.py @@ -481,14 +481,14 @@ def set(self, request, parent_lookup_project, pk=None): if element.attribute == value.attribute: attributes.update([descendant.attribute for descendant in element.descendants]) - # construct the set_prefix for decendants for this set - decendants_set_prefix = f'{value.set_prefix}|{value.set_index}' if value.set_prefix else str(value.set_index) + # construct the set_prefix for descendants for this set + descendants_set_prefix = f'{value.set_prefix}|{value.set_index}' if value.set_prefix else str(value.set_index) - # delete all values for this set and all decendants + # delete all values for this set and all descendants values = self.get_queryset().filter(attribute__in=attributes) \ .filter( Q(set_prefix=value.set_prefix, set_index=value.set_index) | - Q(set_prefix__startswith=decendants_set_prefix) + Q(set_prefix__startswith=descendants_set_prefix) ) values.delete()