aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-28 09:37:29 +0300
committerGravatar ks129 <[email protected]>2020-05-28 09:37:29 +0300
commit9cedba3870947ca10218c65c4106f5dd095d230c (patch)
treefc2f49e92269315d3c5ee2e6b72b61a7e4420543
parentOT: Rename variable `need_more` to `names_needed` (diff)
OT: Rename variable `ext` to `other_names`
-rw-r--r--pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py b/pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py
index 1099922c..9af69ae4 100644
--- a/pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py
+++ b/pydis_site/apps/api/viewsets/bot/off_topic_channel_name.py
@@ -118,18 +118,18 @@ class OffTopicChannelNameViewSet(DestroyModelMixin, ViewSet):
if len(queryset) < random_count:
# Figure out how many additional names we need, and don't fetch duplicate names.
names_needed = random_count - len(queryset)
- ext = self.get_queryset().order_by('?').exclude(
+ other_names = self.get_queryset().order_by('?').exclude(
name__in=(query.name for query in queryset)
)[:names_needed]
# Reset the `used` field to False for all names except the ones we just used.
self.get_queryset().exclude(name__in=(
- query.name for query in ext)
+ query.name for query in other_names)
).update(used=False)
# Join original queryset (that had missing names)
# and extension with these missing names.
- queryset = list(queryset) + list(ext)
+ queryset = list(queryset) + list(other_names)
serialized = self.serializer_class(queryset, many=True)
return Response(serialized.data)