Skip to content

Commit

Permalink
Merge pull request #443 from open5e/tob3_hotfix
Browse files Browse the repository at this point in the history
Tob3 hotfix
  • Loading branch information
augustjohnson authored Apr 12, 2024
2 parents 3c16934 + f107a5c commit cc112f4
Show file tree
Hide file tree
Showing 3 changed files with 21,650 additions and 20,815 deletions.
29 changes: 24 additions & 5 deletions api/models/monster.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ def speed(self):
help_text='String list of environments that the monster can be found in.')

def environments(self):
return json.loads(self.environments_json)
if self.environments_json is None:
return ""
else:
return json.loads(self.environments_json)

strength = models.IntegerField(
null=True, help_text='Integer representing the strength score.')
Expand Down Expand Up @@ -92,23 +95,39 @@ def actions(self):
bonus_actions_json = models.TextField(default=None, null=True)

def bonus_actions(self):
return json.loads(self.bonus_actions_json)
if self.bonus_actions_json is None:
return ""
else:
return json.loads(self.bonus_actions_json)

# A list of special abilities in json text.
special_abilities_json = models.TextField()

def special_abilities(self):
return json.loads(self.special_abilities_json)
if self.special_abilities_json is None:
return ""
else:
return json.loads(self.special_abilities_json)


reactions_json = models.TextField(null=True) # A list of reactions in json text.

def reactions(self):
return json.loads(self.reactions_json)
if self.reactions_json is None:
return ""
else:
return json.loads(self.reactions_json)


legendary_desc = models.TextField(null=True)
# a list of legendary actions in json.
legendary_actions_json = models.TextField(null=True)

def legendary_actions(self):
return json.loads(self.legendary_actions_json)
if self.legendary_actions_json is None:
return ""
else:
return json.loads(self.legendary_actions_json)
spells_json = models.TextField()
spell_list = models.ManyToManyField(
Spell,
Expand Down
2 changes: 1 addition & 1 deletion data/v1/tob-2023/Document.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
"license_url": "http://open5e.com/legal"
}
}
]
]
Loading

0 comments on commit cc112f4

Please sign in to comment.