Skip to content

Commit

Permalink
changed with black
Browse files Browse the repository at this point in the history
  • Loading branch information
Chelakhovl committed Dec 8, 2024
1 parent 43de3e6 commit d889d01
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions BackEnd/authentication/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ class CustomProfileSerializer(serializers.ModelSerializer):

class Meta:
model = Profile
fields = ("name", "is_registered", "is_startup", "is_fop", "official_name")
fields = (
"name",
"is_registered",
"is_startup",
"is_fop",
"official_name",
)


class UserRegistrationSerializer(UserCreatePasswordRetypeSerializer):
Expand Down Expand Up @@ -90,7 +96,10 @@ def validate(self, value):
def create(self, validated_data):
validated_data.pop("captcha", None)
company_data = validated_data.pop("company")
if "official_name" not in company_data or not company_data["official_name"]:
if (
"official_name" not in company_data
or not company_data["official_name"]
):
company_data["official_name"] = None
user = User.objects.create(**validated_data)
user.set_password(validated_data["password"])
Expand Down

0 comments on commit d889d01

Please sign in to comment.