aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2022-03-25 07:47:55 +0800
committerJesús <heckyel@hyperbola.info>2022-03-25 07:47:55 +0800
commit4ff6b579192ca89ebd679f268aafc131756b554b (patch)
tree9a2328891e6a902b172218efddad816092fc8c52
parent3e56416828d3a40dbc991d118a2916d15908789e (diff)
downloadheroeapi-4ff6b579192ca89ebd679f268aafc131756b554b.tar.lz
heroeapi-4ff6b579192ca89ebd679f268aafc131756b554b.tar.xz
heroeapi-4ff6b579192ca89ebd679f268aafc131756b554b.zip
fix empty value
sparse – (optional) sparse=True combined with unique=True and required=False means that uniqueness won’t be enforced for None values
-rw-r--r--database/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/database/models.py b/database/models.py
index 5d6c5a5..f0fe7de 100644
--- a/database/models.py
+++ b/database/models.py
@@ -32,7 +32,7 @@ class PowerstatsModel(EmbeddedDocument):
class BiographyModel(EmbeddedDocument):
- fullname = StringField(required=True, unique=True, max_length=100)
+ fullname = StringField(required=True, unique=True, sparse=True, max_length=100)
alteregos = StringField(required=True, max_length=100)
aliases = ListField(required=True, max_length=100)
placeofbirth = StringField(required=True, max_length=100)