Update mana change

This commit is contained in:
Gabriel Augendre 2022-10-30 22:44:28 +01:00
parent 3876351227
commit 75467f18ac

View file

@ -32,7 +32,10 @@ def character_health_change(request: WSGIRequest, pk: int) -> HttpResponse:
@login_required @login_required
def character_mana_change(request: WSGIRequest, pk: int) -> HttpResponse: def character_mana_change(request: WSGIRequest, pk: int) -> HttpResponse:
character = get_object_or_404( character = get_object_or_404(
Character.objects.only("mana_remaining", "level", "value_intelligence"), pk=pk Character.objects.only(
"mana_remaining", "level", "value_intelligence", "profile"
).select_related("profile"),
pk=pk,
) )
value = get_updated_value(request, character.mana_remaining, character.mana_max) value = get_updated_value(request, character.mana_remaining, character.mana_max)
character.mana_remaining = value character.mana_remaining = value