Fix a mutable default function arg noticed when digging through history API code.

This commit is contained in:
Dannon Baker
2018-01-23 10:33:08 -05:00
parent 4da1dad394
commit 0dae63a578
+3 -1
View File
@@ -507,7 +507,7 @@ class HistoriesController(BaseAPIController, ExportsHistoryMixin, ImportsHistory
return self.serve_ready_history_export(trans, jeha)
@expose_api
def get_custom_builds_metadata(self, trans, id, payload={}, **kwd):
def get_custom_builds_metadata(self, trans, id, payload=None, **kwd):
"""
GET /api/histories/{id}/custom_builds_metadata
Returns meta data for custom builds.
@@ -515,6 +515,8 @@ class HistoriesController(BaseAPIController, ExportsHistoryMixin, ImportsHistory
:param id: the encoded history id
:type id: str
"""
if payload is None:
payload = {}
history = self.history_manager.get_accessible(self.decode_id(id), trans.user, current_history=trans.history)
installed_builds = []
for build in glob.glob(os.path.join(trans.app.config.len_file_path, "*.len")):