Fix character creation

This commit is contained in:
Gabriel Augendre 2022-11-10 11:40:51 +01:00
parent 6158002796
commit c43c33f06f
3 changed files with 2 additions and 2 deletions

View file

@ -80,7 +80,6 @@ class CharacterCreateForm(forms.ModelForm):
"armor", "armor",
"shield", "shield",
"defense_misc", "defense_misc",
"initiative_misc",
"equipment", "equipment",
"money_pp", "money_pp",
"money_po", "money_po",

View file

@ -318,7 +318,7 @@ class Character(models.Model):
@property @property
def luck_points_max(self) -> int: def luck_points_max(self) -> int:
return 3 + self.modifier_charisma return max([3 + self.modifier_charisma, 0])
@property @property
def health_remaining_percent(self) -> float: def health_remaining_percent(self) -> float:

View file

@ -6,6 +6,7 @@
{% block content %} {% block content %}
<h1>Création de personnage</h1> <h1>Création de personnage</h1>
<form action="" method="post"> <form action="" method="post">
{% bootstrap_form_errors form %}
{% csrf_token %} {% csrf_token %}
<h2>Identité</h2> <h2>Identité</h2>
{% bootstrap_field form.name %} {% bootstrap_field form.name %}