Skip to content

Commit

Permalink
Upgrade ruff to latest
Browse files Browse the repository at this point in the history
This newest version takes a number of rules out of preview mode, which
is why we include fixes here!
  • Loading branch information
DavidCain committed Jul 7, 2024
1 parent 1ce350b commit 582654c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
37 changes: 19 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion ws/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ def signups_to_update(signup_list, trip):
# Return unevaluated QuerySet objects (allows update() and all() calls)
keep_on_trip = (
trip.signup_set.filter(pk__in=normal_signups)
.extra(select={"ordering": f"case {ordering} end"}, order_by=("ordering",))
.extra( # noqa: S610
select={"ordering": f"case {ordering} end"},
order_by=("ordering",),
)
.select_related("waitlistsignup")
)
to_delete = trip.signup_set.filter(pk__in=deletions)
Expand Down
5 changes: 1 addition & 4 deletions ws/utils/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,4 @@ def ws_lectures_complete() -> bool:

if trips_this_ws.filter(trip_date__lt=today):
return True
if trips_this_ws.filter(trip_date__gte=today) and after_thursday:
return True
# It's Winter School, but it's not late enough in the first week
return False
return trips_this_ws.filter(trip_date__gte=today).exists() and after_thursday
5 changes: 2 additions & 3 deletions ws/utils/ratings.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ def _chair_should_recommend(app: AnnotatedApplication) -> bool:
return False
if app.num_recs: # The chair has already made a recommendation
return False
if app.num_ratings: # The application received a rating
return False
return True
# If the application received a rating, we don't need recommendations
return not app.num_ratings

def needs_rec(
self,
Expand Down
2 changes: 1 addition & 1 deletion ws/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ws.settings")

from django.core.wsgi import get_wsgi_application # noqa: E402,I001
from django.core.wsgi import get_wsgi_application # noqa: I001


application = get_wsgi_application()

0 comments on commit 582654c

Please sign in to comment.