mirror of https://github.com/dirtbags/moth.git
Merge pull request #126 from dirtbags/fix_authors_check
Fixing issue with detecting which authors/author field to use
This commit is contained in:
commit
3d15c581f0
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- 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).
|
||||
### Fixed
|
||||
- Handle cases where non-legacy puzzles don't have an `author` attribute
|
||||
- Handle YAML-formatted file and script lists as expected
|
||||
- YAML-formatted example puzzle actually works as expected
|
||||
|
||||
|
|
|
@ -412,7 +412,12 @@ class Puzzle:
|
|||
self.body.write('</pre>')
|
||||
|
||||
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):
|
||||
return self.body.getvalue()
|
||||
|
|
Loading…
Reference in New Issue