Skip to content

Commit

Permalink
fix(api): update enum usage to work for python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Mary Hipp authored and hipsterusername committed Oct 12, 2024
1 parent acfeb4a commit 80360a8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions invokeai/app/services/board_records/board_records_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ def get_many(
# Determine archived filter condition
archived_filter = "" if include_archived else "WHERE archived = 0"

final_query = base_query.format(archived_filter=archived_filter, order_by=order_by, direction=direction)
final_query = base_query.format(
archived_filter=archived_filter, order_by=order_by.value, direction=direction.value
)

# Execute query to fetch boards
self._cursor.execute(final_query, (limit, offset))
Expand Down Expand Up @@ -208,7 +210,7 @@ def get_all(
try:
self._lock.acquire()

if order_by == "board_name":
if order_by == BoardRecordOrderBy.Name:
base_query = """
SELECT *
FROM boards
Expand All @@ -225,7 +227,9 @@ def get_all(

archived_filter = "" if include_archived else "WHERE archived = 0"

final_query = base_query.format(archived_filter=archived_filter, order_by=order_by, direction=direction)
final_query = base_query.format(
archived_filter=archived_filter, order_by=order_by.value, direction=direction.value
)

self._cursor.execute(final_query)

Expand Down

0 comments on commit 80360a8

Please sign in to comment.