Skip to content

Commit

Permalink
[staged-updates] normalize whitespace on study creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
biblicabeebli committed Aug 21, 2024
1 parent d2dba7f commit dcbaf32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions endpoints/study_endpoints.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import re
from io import BytesIO

import bleach
Expand Down Expand Up @@ -225,6 +226,9 @@ def create_study(request: ResearcherRequest):
messages.error(request, 'the study name you provided was too long and was rejected, please try again.')
return redirect('/create_study')

# normalize all sequences of whitespace to a single space
name = re.sub("\s", " ", name)

if escape(name) != name:
if not RUNNING_TEST_OR_FROM_A_SHELL:
with make_error_sentry(SentryTypes.elastic_beanstalk):
Expand Down

0 comments on commit dcbaf32

Please sign in to comment.