Fix critical issues that will happen on 1.2 to 1.3 migration

This commit is contained in:
Frisk 2020-11-18 14:58:13 +01:00
parent 39480349a7
commit af19a14eee
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC
2 changed files with 7 additions and 2 deletions

View file

@ -89,7 +89,12 @@ class DataFile:
self.changed = True
def __getitem__(self, item):
try:
return self.data[item]
except KeyError: # if such value doesn't exist, set to and return none
self.__setitem__(item, None)
self.save_datafile()
return None
datafile = DataFile()

View file

@ -242,7 +242,7 @@ class Recent_Changes_Class(object):
return
else:
rc_last_id = self.prepare_rc(rc, amount)
if settings["show_abuselog"]:
if settings.get("show_abuselog", False):
try:
abuselog = request_json["query"]["abuselog"] # While LYBL approach would be more performant when abuselog is not in request body, I prefer this approach for its clarity
except KeyError: