Skip to content

Commit

Permalink
Perform bugfixing on redaction feature
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Jan 3, 2024
1 parent dae78c5 commit 22af2d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/globaleaks/handlers/recipient/rtip.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ def db_redact_comment(session, tid, user_id, itip_id, redaction, redaction_data,

def db_redact_answers(answers, redaction):
for key in answers:
if not re.match(requests.uuid_regexp, key):
if not re.match(requests.uuid_regexp, key) or \
not isinstance(answers[key], list):
continue

for inner_idx, answer in enumerate(answers[key]):
Expand Down Expand Up @@ -649,7 +650,8 @@ def get_rtip(session, tid, user_id, itip_id, language):

def redact_answers(answers, redactions):
for key in answers:
if not re.match(requests.uuid_regexp, key):
if not re.match(requests.uuid_regexp, key) or \
not isinstance(answers[key], list):
continue

for inner_idx, answer in enumerate(answers[key]):
Expand Down

0 comments on commit 22af2d6

Please sign in to comment.