Skip to content

Commit 56e68fc

Browse files
committed
Test
1 parent 168ad64 commit 56e68fc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

core/thread.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ async def find(self, *, recipient=None, channel=None):
224224
if recipient is None and channel is not None:
225225
return await self._find_from_channel(channel)
226226
try:
227+
print(self.cache)
227228
thread = self.cache[recipient.id]
228229
except KeyError:
230+
print('Couldnt find from cache...')
229231
channel = discord.utils.get(
230232
self.bot.modmail_guild.text_channels,
231233
topic=f'User ID: {recipient.id}'
@@ -318,7 +320,15 @@ async def create(self, recipient, *, creator=None):
318320
return thread
319321

320322
async def find_or_create(self, recipient):
321-
return await self.find(recipient=recipient) or await self.create(recipient)
323+
maybe = await self.find(recipient=recipient)
324+
print(f'finding: {maybe}')
325+
if maybe:
326+
print('returning maybe')
327+
return maybe
328+
else:
329+
thread = await self.create(recipient)
330+
print('creating')
331+
return thread
322332

323333
@staticmethod
324334
def valid_image_url(url):

0 commit comments

Comments
 (0)