Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 1, 2024
1 parent 72e5d9f commit a2104c0
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions omeroweb/webgateway/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3589,22 +3589,22 @@ def limit_generator(generator, max_items):
source = request.POST if request.method == "POST" else request.GET
try:
# Limit number of items to avoid problems when given massive ranges
rows = list(limit_generator(
(
row
for item in source.get("rows").split(",")
for row in parse(item)
),
settings.MAX_TABLE_SLICE_SIZE
))
columns = list(limit_generator(
(
column
for item in source.get("columns").split(",")
for column in parse(item)
),
settings.MAX_TABLE_SLICE_SIZE / len(rows)
))
rows = list(
limit_generator(
(row for item in source.get("rows").split(",") for row in parse(item)),
settings.MAX_TABLE_SLICE_SIZE,
)
)
columns = list(
limit_generator(
(
column
for item in source.get("columns").split(",")
for column in parse(item)
),
settings.MAX_TABLE_SLICE_SIZE / len(rows),
)
)
except (ValueError, AttributeError) as error:
return {
"error": f"Need comma-separated list of rows and columns ({str(error)})"
Expand Down

0 comments on commit a2104c0

Please sign in to comment.