mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
fixed black pipeline
This commit is contained in:
parent
deb8f865df
commit
5195352975
@ -167,17 +167,14 @@ class LoginForm(AuthenticationForm):
|
|||||||
try:
|
try:
|
||||||
if account_code.match(data["username"]):
|
if account_code.match(data["username"]):
|
||||||
user = (
|
user = (
|
||||||
Customer.objects.filter(
|
Customer.objects.filter(account_id__iexact=data["username"])
|
||||||
account_id__iexact=data["username"])
|
|
||||||
.first()
|
.first()
|
||||||
.user
|
.user
|
||||||
)
|
)
|
||||||
elif "@" in data["username"]:
|
elif "@" in data["username"]:
|
||||||
user = User.objects.filter(
|
user = User.objects.filter(email__iexact=data["username"]).first()
|
||||||
email__iexact=data["username"]).first()
|
|
||||||
else:
|
else:
|
||||||
user = User.objects.filter(
|
user = User.objects.filter(username=data["username"]).first()
|
||||||
username=data["username"]).first()
|
|
||||||
data["username"] = user.username
|
data["username"] = user.username
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -282,8 +279,7 @@ class UserProfileForm(forms.ModelForm):
|
|||||||
new_file = SithFile(
|
new_file = SithFile(
|
||||||
parent=parent,
|
parent=parent,
|
||||||
name=self.generate_name(field, f),
|
name=self.generate_name(field, f),
|
||||||
file=resize_image(
|
file=resize_image(im, 400, f.content_type.split("/")[-1]),
|
||||||
im, 400, f.content_type.split("/")[-1]),
|
|
||||||
owner=self.instance,
|
owner=self.instance,
|
||||||
is_folder=False,
|
is_folder=False,
|
||||||
mime_type=f.content_type,
|
mime_type=f.content_type,
|
||||||
@ -350,8 +346,7 @@ class PagePropForm(forms.ModelForm):
|
|||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Page
|
model = Page
|
||||||
fields = ["parent", "name", "owner_group",
|
fields = ["parent", "name", "owner_group", "edit_groups", "view_groups"]
|
||||||
"edit_groups", "view_groups"]
|
|
||||||
|
|
||||||
edit_groups = make_ajax_field(
|
edit_groups = make_ajax_field(
|
||||||
Page, "edit_groups", "groups", help_text="", label=_("edit groups")
|
Page, "edit_groups", "groups", help_text="", label=_("edit groups")
|
||||||
@ -369,8 +364,7 @@ class PagePropForm(forms.ModelForm):
|
|||||||
class PageForm(forms.ModelForm):
|
class PageForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Page
|
model = Page
|
||||||
fields = ["parent", "name", "owner_group",
|
fields = ["parent", "name", "owner_group", "edit_groups", "view_groups"]
|
||||||
"edit_groups", "view_groups"]
|
|
||||||
|
|
||||||
edit_groups = make_ajax_field(
|
edit_groups = make_ajax_field(
|
||||||
Page, "edit_groups", "groups", help_text="", label=_("edit groups")
|
Page, "edit_groups", "groups", help_text="", label=_("edit groups")
|
||||||
|
Loading…
Reference in New Issue
Block a user