Skip to main content
Bounty Awarded with 50 reputation awarded by User1974
added 420 characters in body
Source Link
Reinderien
  • 71.1k
  • 5
  • 76
  • 256

You haven't used this:

IGNORE_RULES

in your call to setValue.

Also, you have a double call to close; delete the first one.

resp does not benefit from being pre-initialized to an empty string; you can delete that line.

The only other thing I see is that this:

params = [
    param for param in request.getQueryParams()
    if param.startswith('f_')
]
paramdict = {
    p[2:]: request.getQueryParam(p)
    for p in params
}

can be condensed to only the dictionary comprehension:

paramdict = {
    p[2:]: request.getQueryParam(p)
    for p in request.getQueryParams()
    if p.startswith('f_')
}

You haven't used this:

IGNORE_RULES

in your call to setValue.

Also, you have a double call to close; delete the first one.

resp does not benefit from being pre-initialized to an empty string; you can delete that line.

You haven't used this:

IGNORE_RULES

in your call to setValue.

Also, you have a double call to close; delete the first one.

resp does not benefit from being pre-initialized to an empty string; you can delete that line.

The only other thing I see is that this:

params = [
    param for param in request.getQueryParams()
    if param.startswith('f_')
]
paramdict = {
    p[2:]: request.getQueryParam(p)
    for p in params
}

can be condensed to only the dictionary comprehension:

paramdict = {
    p[2:]: request.getQueryParam(p)
    for p in request.getQueryParams()
    if p.startswith('f_')
}
Source Link
Reinderien
  • 71.1k
  • 5
  • 76
  • 256

You haven't used this:

IGNORE_RULES

in your call to setValue.

Also, you have a double call to close; delete the first one.

resp does not benefit from being pre-initialized to an empty string; you can delete that line.