mirror of
https://gitlab.com/chicken-riders/RcGcDw.git
synced 2025-02-23 00:24:09 +00:00
Fix critical issues that will happen on 1.2 to 1.3 migration
This commit is contained in:
parent
39480349a7
commit
af19a14eee
|
@ -89,7 +89,12 @@ class DataFile:
|
||||||
self.changed = True
|
self.changed = True
|
||||||
|
|
||||||
def __getitem__(self, item):
|
def __getitem__(self, item):
|
||||||
return self.data[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()
|
datafile = DataFile()
|
||||||
|
|
|
@ -242,7 +242,7 @@ class Recent_Changes_Class(object):
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
rc_last_id = self.prepare_rc(rc, amount)
|
rc_last_id = self.prepare_rc(rc, amount)
|
||||||
if settings["show_abuselog"]:
|
if settings.get("show_abuselog", False):
|
||||||
try:
|
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
|
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:
|
except KeyError:
|
||||||
|
|
Loading…
Reference in a new issue