Skip to content

Commit 255afe7

Browse files
committed
Fix crashing instead of just denying access in can_download_bot_zip/can_download_bot_data
1 parent 9245fe8 commit 255afe7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

aiarena/core/models/bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def can_download_bot_zip(self, user):
210210
self.user.id == user.id
211211
or self.bot_zip_publicly_downloadable
212212
or user.is_staff
213-
or (user.is_arenaclient and user.arenaclient.trusted)
213+
or (user.is_authenticated and user.is_arenaclient and user.arenaclient.trusted)
214214
)
215215

216216
def can_download_bot_data(self, user):
@@ -225,7 +225,7 @@ def can_download_bot_data(self, user):
225225
self.user.id == user.id
226226
or self.bot_data_publicly_downloadable
227227
or user.is_staff
228-
or (user.is_arenaclient and user.arenaclient.trusted)
228+
or (user.is_authenticated and user.is_arenaclient and user.arenaclient.trusted)
229229
)
230230

231231
# for purpose of distinquish news in activity feed

0 commit comments

Comments
 (0)