Skip to content

Commit 37b436d

Browse files
committed
fix: 0.11.4, register_callback
1 parent 8af4577 commit 37b436d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# PEP 621 project metadata
33
# See https://www.python.org/dev/peps/pep-0621/
44
name = "graia-amnesia"
5-
version = "0.11.3"
5+
version = "0.11.4"
66
authors = [
77
{name = "GreyElaina", email = "[email protected]"},
88
{name = "RF-Tar-Railt", email = "[email protected]"}

src/graia/amnesia/builtins/sqla/model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ def register_callback(callback: Callable[[type["Base"], dict[str, Any]], Any], a
2727
callback: A callable that takes the class and its kwargs as arguments.
2828
after: If True, the callback will be called after the class is fully constructed.
2929
"""
30-
_callbacks.append(callback)
30+
if after:
31+
_after_callbacks.append(callback)
32+
else:
33+
_callbacks.append(callback)
3134

3235

3336
def remove_callback(callback: Callable[[type["Base"], dict[str, Any]], Any]) -> None:

0 commit comments

Comments
 (0)