Skip to content

Commit

Permalink
Fixed map folder list crashing on missing author. (#1225)
Browse files Browse the repository at this point in the history
* Allow creation of map folders restricted to admins only.

* Implemented downgrade in mapfolder visibility database migration.

* Fixed displaying admins_only folders to all admins.

* Fixed map folder list crashing on missing author.
  • Loading branch information
TheMaximum committed Nov 5, 2022
1 parent 5e6b0e8 commit 801985f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pyplanet/apps/contrib/jukebox/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,13 @@ async def map_to_dict(self, map):
if any(f['index'] == "karma" for f in self.fields) and 'karma' in self.app.instance.apps.apps:
dict_item['karma'] = (await self.app.instance.apps.apps['karma'].get_map_karma(map))['map_karma']

# Use custom field for author to allow for searching on both login and nickname (depending on what's shown).
dict_item['author'] = (
dict_item['author_nickname']
if 'author_nickname' in dict_item and dict_item['author_nickname']
else dict_item['author_login']
)

return dict_item


Expand Down

0 comments on commit 801985f

Please sign in to comment.