Skip to content

Commit

Permalink
Removed unsued function with an incomplete approach to parsing multis…
Browse files Browse the repository at this point in the history
…elect form data
  • Loading branch information
Daniel van Balen committed Jul 6, 2020
1 parent 7e6d6fc commit 103e509
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions ckanext/cfpb_extrafields/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,6 @@ def end_after_start_validator(key, flattened_data, errors, context):
Invalid("content start date occurs after end date")
return

def __clean_select_multi(raw_s):
''' parses the results of an html form select-multi '''
# This solution allows commas, but is unpythonic
if not raw_s:
return []
if not isinstance(raw_s, basestring):
return raw_s
if (raw_s[:2],raw_s[-2:]) == ('{"','"}'):
s = '['+raw_s[1:-1]+']'
return json.loads(s)
else:
return [ raw_s ]

# select multis are contained in unicode strings that look like:
# u'{"blah blah","blah asdf",asdf}' ; u'{asdf,asdf}' ; u'asdf' (see also tests.py)
def clean_select_multi(raw_s):
Expand Down

0 comments on commit 103e509

Please sign in to comment.