Skip to content

Commit

Permalink
config fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bugsbirb committed Mar 13, 2024
1 parent 357b0c5 commit c86d1f0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
6 changes: 1 addition & 5 deletions Cogs/Configuration/Views/loaview.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,8 @@ async def callback(self, interaction: discord.Interaction):
'staffrole': selected_role_id.id
}
try:
existing_record = LOARole.find_one(filter)

if existing_record:
await LOARole.update_one(filter, {'$set': data})
else:
await LOARole.insert_one(data)
await LOARole.update_one(filter, {'$set': data}, upsert=True)
await interaction.response.edit_message(content=None)
await refreshembed(interaction)
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion Cogs/Configuration/Views/partnershipsview.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def callback(self, interaction: discord.Interaction):
}

try:
existing_record = partnershipsch.find_one(filter)
existing_record = await partnershipsch.find_one(filter)

if existing_record:
await partnershipsch.update_one(filter, {'$set': data})
Expand Down
8 changes: 1 addition & 7 deletions Cogs/Configuration/Views/promotionsview.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,7 @@ async def callback(self, interaction: discord.Interaction):
}

try:
existing_record = promochannel.find_one(filter)

if existing_record:
await promochannel.update_one(filter, {'$set': data})
else:
await promochannel.insert_one(data)

await promochannel.update_one(filter, {'$set': data}, upsert=True)
await refreshembed(interaction)
await interaction.response.edit_message(content=None)
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion Cogs/Configuration/Views/reportview.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def callback(self, interaction: discord.Interaction):
}

try:
existing_record = repchannel.find_one(filter)
existing_record = await repchannel.find_one(filter)

if existing_record:
repchannel.update_one(filter, {'$set': data})
Expand Down

0 comments on commit c86d1f0

Please sign in to comment.