Closed ribosomerocker closed 4 years ago
find_by_id
needs to explicitly check if the data is none rather then using not
find_by_custom
, see abovedelete_by_id
, no need for the if. Simply call the method and if it errors it errorsinsert
, while we are at it. Let's change away from built-in types, so rename dict
to data
or somethingupsert
, see aboveupdate_by_id
, see aboveupdate_by_id
, no need for the ifunset
, see both of the ones for update_by_id
increment
, no need for the ifThis relates to Episode 21
code, however it is in the Pyro
mongo code. Given our upsert
method does not check whether or not the item exists, it simply calls update_by_id
this causes issues on guilds that don't exist because in update_by_id
we return
if the item does not exist. See where this is going....
Your choice how it is resolved. But it does need to be resolved or any data currently upserted in new guilds is not being stored
- [ ]
find_by_id
needs to explicitly check if the data is none rather then usingnot
- [ ]
find_by_custom
, see above- [ ]
delete_by_id
, no need for the if. Simply call the method and if it errors it errors- [ ]
insert
, while we are at it. Let's change away from built-in types, so renamedict
todata
or something- [ ]
upsert
, see above- [ ]
update_by_id
, see above- [ ]
update_by_id
, no need for the if- [ ]
unset
, see both of the ones forupdate_by_id
- [ ]
increment
, no need for the if
I don't see the need for being more explicit here, there doesn't seem to be some sort of value in a string that would mess this up other than, well... the string having no value. Using the is None
treatment could be harder to make sense of in a quick look as well, and is more verbose.
Theres more in this file that needs changing. Might as well do it now