Features: None;
Fixes: 1) Correct inconsistent formatting in `vibes_auth` phone number validation logic; 2) Resolve redundant newlines in `core/utils/emailing.py` logging statement; Extra: 1) Cleaned up line breaks for better readability and consistency.
This commit is contained in:
parent
a44b8fb652
commit
f345a1bfed
3 changed files with 5 additions and 12 deletions
|
|
@ -115,12 +115,7 @@ def send_order_finished_email(order_pk: str) -> tuple[bool, str]:
|
|||
)
|
||||
email.content_subtype = "html"
|
||||
result = email.send()
|
||||
logger.debug(
|
||||
"Order %s: Tried to send email to %s, resulted with %s",
|
||||
order.pk,
|
||||
order.user.email,
|
||||
result
|
||||
)
|
||||
logger.debug("Order %s: Tried to send email to %s, resulted with %s", order.pk, order.user.email, result)
|
||||
|
||||
def send_thank_you_email(ops: list[OrderProduct]):
|
||||
if ops:
|
||||
|
|
|
|||
|
|
@ -118,9 +118,9 @@ class UpdateUser(BaseMutation):
|
|||
|
||||
phone_number = kwargs.get("phone_number")
|
||||
|
||||
if (phone_number is not None and not is_valid_phone_number(phone_number)) or (User.objects.filter(
|
||||
phone_number=phone_number
|
||||
).exclude(uuid=uuid).exists() and phone_number is not None):
|
||||
if (phone_number is not None and not is_valid_phone_number(phone_number)) or (
|
||||
User.objects.filter(phone_number=phone_number).exclude(uuid=uuid).exists() and phone_number is not None
|
||||
):
|
||||
raise BadRequest(_(f"malformed phone number: {phone_number}"))
|
||||
|
||||
password = kwargs.get("password", "")
|
||||
|
|
|
|||
|
|
@ -103,9 +103,7 @@ class UserSerializer(ModelSerializer):
|
|||
raise ValidationError(_("passwords do not match"))
|
||||
if "phone_number" in attrs:
|
||||
validate_phone_number(attrs["phone_number"])
|
||||
if User.objects.filter(phone_number=attrs["phone_number"]).exclude(
|
||||
uuid=self.instance.uuid
|
||||
).exists():
|
||||
if User.objects.filter(phone_number=attrs["phone_number"]).exclude(uuid=self.instance.uuid).exists():
|
||||
phone_number = attrs["phone_number"]
|
||||
raise ValidationError(_(f"malformed phone number: {phone_number}"))
|
||||
if "email" in attrs:
|
||||
|
|
|
|||
Loading…
Reference in a new issue