mirror of https://github.com/dirtbags/moth.git
Fixing issue with detecting which authors/author field to use
This commit is contained in:
parent
8809580355
commit
d6818dc409
|
@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Added
|
### Added
|
||||||
- URL parameter to points.json to allow returning only the JSON for a single
|
- URL parameter to points.json to allow returning only the JSON for a single
|
||||||
team by its team id (e.g., points.json?id=abc123).
|
team by its team id (e.g., points.json?id=abc123).
|
||||||
|
### Fixed
|
||||||
|
- Handle cases where non-legacy puzzles don't have an `author` attribute
|
||||||
|
|
||||||
## [3.4.3] - 2019-11-20
|
## [3.4.3] - 2019-11-20
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -384,7 +384,12 @@ class Puzzle:
|
||||||
self.body.write('</pre>')
|
self.body.write('</pre>')
|
||||||
|
|
||||||
def get_authors(self):
|
def get_authors(self):
|
||||||
return self.authors or [self.author]
|
if len(self.authors) > 0:
|
||||||
|
return self.authors
|
||||||
|
elif hasattr(self, "author"):
|
||||||
|
return [self.author]
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
def get_body(self):
|
def get_body(self):
|
||||||
return self.body.getvalue()
|
return self.body.getvalue()
|
||||||
|
|
Loading…
Reference in New Issue