rating-patch
Some checks failed
Deploy on push / deploy (push) Failing after 1m33s

This commit is contained in:
2025-09-01 16:29:50 +03:00
parent b342a01a8f
commit 143157a771
2 changed files with 32 additions and 19 deletions

View File

@@ -15,9 +15,21 @@ POSITIVE_REACTIONS = [ReactionKind.ACCEPT.value, ReactionKind.LIKE.value, Reacti
NEGATIVE_REACTIONS = [ReactionKind.REJECT.value, ReactionKind.DISLIKE.value, ReactionKind.DISPROOF.value]
def is_negative(x: ReactionKind) -> bool:
return x.value in NEGATIVE_REACTIONS
def is_negative(x: ReactionKind | str) -> bool:
"""Проверяет, является ли реакция негативной.
Args:
x: ReactionKind enum или строка с названием реакции
"""
value = x.value if isinstance(x, ReactionKind) else x
return value in NEGATIVE_REACTIONS
def is_positive(x: ReactionKind) -> bool:
return x.value in POSITIVE_REACTIONS
def is_positive(x: ReactionKind | str) -> bool:
"""Проверяет, является ли реакция позитивной.
Args:
x: ReactionKind enum или строка с названием реакции
"""
value = x.value if isinstance(x, ReactionKind) else x
return value in POSITIVE_REACTIONS