Skip to content

Commit

Permalink
Update database.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Oct 31, 2023
1 parent fade544 commit 52a6f5e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions discordgsm/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,11 @@ def update_servers_style_data(self, servers: list[Server]):

def __update_servers_channel_id(self, servers: list[Server], channel_id: int):
if self.driver == Driver.MongoDB:
max_position = self.collection.find_one({'channel_id': channel_id}, sort=[
('position', -1)])["position"]
try:
max_position = self.collection.find_one({'channel_id': channel_id}, sort=[
('position', -1)])["position"]
except TypeError:
max_position = 0

operations = []

Expand Down

0 comments on commit 52a6f5e

Please sign in to comment.