Skip to content

Commit 22db60f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 5d86076 commit 22db60f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

openlibrary/plugins/upstream/addbook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def new_doc(type_: str, **data) -> Author | Edition | Work | List | Series:
117117
# When lists were created they didn't have their sequence registered correctly,
118118
# so we need to do this a bit differently
119119
next_value = web.ctx.site.seq.next_value("list")
120-
key = f"/{type_.split('/')[-1]}/OL{next_value}L"
120+
key = f"/{type_.rsplit('/', maxsplit=1)[-1]}/OL{next_value}L"
121121
else:
122122
key = web.ctx.site.new_key(type_)
123123
data['key'] = key

0 commit comments

Comments
 (0)