Skip to content

Commit

Permalink
Merge pull request #715 from FJNR-inc/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
RignonNoel authored Oct 3, 2020
2 parents 3f0a778 + e1bd44b commit d3bad3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion blitz_api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ def validate_phone(self, value):
return value

def validate_other_phone(self, value):
return phone_number_validator(value)
if value is not None:
return phone_number_validator(value)
return value

def validate(self, attrs):
"""Validate university and email match"""
Expand Down
3 changes: 2 additions & 1 deletion blitz_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ def update(self, request, *args, **kwargs):

def create(self, request, *args, **kwargs):
response = super().create(request, *args, **kwargs)
user = User.objects.get(email=request.data["email"])
if response.status_code == status.HTTP_201_CREATED:
user = User.objects.get(email=request.data["email"])

if settings.LOCAL_SETTINGS['AUTO_ACTIVATE_USER'] is True:
user.is_active = True
user.save()
Expand Down
4 changes: 2 additions & 2 deletions store/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,13 @@ def validate_coupon_for_order(coupon, order):
list_physical_retreat_id_applicable = Retreat.objects.none()
if coupon.is_applicable_to_physical_retreat:
list_physical_retreat_id_applicable = Retreat.objects.filter(
type=Retreat.TYPE_PHYSICAL
type__is_virtual=False,
)

list_virtual_retreat_id_applicable = Retreat.objects.none()
if coupon.is_applicable_to_virtual_retreat:
list_virtual_retreat_id_applicable = Retreat.objects.filter(
type=Retreat.TYPE_VIRTUAL
type__is_virtual=True,
)

applicable_orderlines = order.order_lines.filter(
Expand Down

0 comments on commit d3bad3b

Please sign in to comment.