mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
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:
@ -94,11 +94,13 @@ class SubscriptionForm(forms.ModelForm):
|
||||
self.errors.pop("email", None)
|
||||
self.errors.pop("date_of_birth", None)
|
||||
if cleaned_data.get("member") is None:
|
||||
# This should be handled here, but it is done in the Subscription model's clean method
|
||||
# This should be handled here,
|
||||
# but it is done in the Subscription model's clean method
|
||||
# TODO investigate why!
|
||||
raise ValidationError(
|
||||
_(
|
||||
"You must either choose an existing user or create a new one properly"
|
||||
"You must either choose an existing "
|
||||
"user or create a new one properly"
|
||||
)
|
||||
)
|
||||
return cleaned_data
|
||||
@ -114,7 +116,7 @@ class NewSubscription(CreateView):
|
||||
raise PermissionDenied
|
||||
|
||||
def get_initial(self):
|
||||
if "member" in self.request.GET.keys():
|
||||
if "member" in self.request.GET:
|
||||
return {
|
||||
"member": self.request.GET["member"],
|
||||
"subscription_type": "deux-semestres",
|
||||
|
Reference in New Issue
Block a user