Add more Ruff rules (#891)

* ruff: apply rule F

* ruff: apply rule E

* ruff: apply rule SIM

* ruff: apply rule TCH

* ruff: apply rule ERA

* ruff: apply rule PLW

* ruff: apply rule FLY

* ruff: apply rule PERF

* ruff: apply rules FURB & RUF
This commit is contained in:
thomas girod
2024-10-15 11:36:26 +02:00
committed by GitHub
parent d114b01bcc
commit d16a207a83
82 changed files with 836 additions and 748 deletions

View File

@ -55,9 +55,9 @@ class Trombi(models.Model):
_("subscription deadline"),
default=date.today,
help_text=_(
"Before this date, users are "
"allowed to subscribe to this Trombi. "
"After this date, users subscribed will be allowed to comment on each other."
"Before this date, users are allowed to subscribe to this Trombi. "
"After this date, users subscribed will"
" be allowed to comment on each other."
),
)
comments_deadline = models.DateField(
@ -131,7 +131,8 @@ class TrombiUser(models.Model):
null=True,
blank=True,
help_text=_(
"The profile picture you want in the trombi (warning: this picture may be published)"
"The profile picture you want in the trombi "
"(warning: this picture may be published)"
),
)
scrub_pict = models.ImageField(
@ -140,7 +141,8 @@ class TrombiUser(models.Model):
null=True,
blank=True,
help_text=_(
"The scrub picture you want in the trombi (warning: this picture may be published)"
"The scrub picture you want in the trombi "
"(warning: this picture may be published)"
),
)
@ -158,10 +160,7 @@ class TrombiUser(models.Model):
role = str(settings.SITH_CLUB_ROLES[m.role])
if m.description:
role += " (%s)" % m.description
if m.end_date:
end_date = get_semester_code(m.end_date)
else:
end_date = ""
end_date = get_semester_code(m.end_date) if m.end_date else ""
TrombiClubMembership(
user=self,
club=str(m.club),