Skip to content

Commit

Permalink
Ensure eval version buttons ascend in release date
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Oct 7, 2024
1 parent 29a1310 commit b29ef1e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bot/exts/utils/snekbox/_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def print_last_line():

SupportedPythonVersions = Literal["3.12", "3.13", "3.13t"]


class FilteredFiles(NamedTuple):
allowed: list[FileAttachment]
blocked: list[FileAttachment]
Expand Down Expand Up @@ -180,7 +179,9 @@ def build_python_version_switcher_view(
job: EvalJob,
) -> interactions.ViewWithUserAndRoleCheck:
"""Return a view that allows the user to change what version of Python their code is run on."""
other_versions = set(get_args(SupportedPythonVersions)) - {current_python_version}
other_versions = list(get_args(SupportedPythonVersions))
other_versions.remove(current_python_version)

view = interactions.ViewWithUserAndRoleCheck(
allowed_users=(ctx.author.id,),
allowed_roles=MODERATION_ROLES,
Expand Down

0 comments on commit b29ef1e

Please sign in to comment.