From c43c33f06f3cf29a9e69067d0e348b509932e2d4 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 10 Nov 2022 11:40:51 +0100 Subject: [PATCH] Fix character creation --- src/character/forms.py | 1 - src/character/models/character.py | 2 +- src/character/templates/character/character_form.html | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/character/forms.py b/src/character/forms.py index fbbd8d5..cbfa88f 100644 --- a/src/character/forms.py +++ b/src/character/forms.py @@ -80,7 +80,6 @@ class CharacterCreateForm(forms.ModelForm): "armor", "shield", "defense_misc", - "initiative_misc", "equipment", "money_pp", "money_po", diff --git a/src/character/models/character.py b/src/character/models/character.py index 239fc04..431b8c6 100644 --- a/src/character/models/character.py +++ b/src/character/models/character.py @@ -318,7 +318,7 @@ class Character(models.Model): @property def luck_points_max(self) -> int: - return 3 + self.modifier_charisma + return max([3 + self.modifier_charisma, 0]) @property def health_remaining_percent(self) -> float: diff --git a/src/character/templates/character/character_form.html b/src/character/templates/character/character_form.html index d2ac4ba..e512d5b 100644 --- a/src/character/templates/character/character_form.html +++ b/src/character/templates/character/character_form.html @@ -6,6 +6,7 @@ {% block content %}

Création de personnage

+ {% bootstrap_form_errors form %} {% csrf_token %}

Identité

{% bootstrap_field form.name %}