Skip to content

Commit

Permalink
Merge branch 'dev' into refactor(album)/sort-by-date
Browse files Browse the repository at this point in the history
  • Loading branch information
MadsNyl authored Nov 4, 2024
2 parents b1ebbf6 + b5670f0 commit 7e0f87f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/career/views/weekly_business.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def create(self, request, *args, **kwargs):
except ValueError:
return Response(
{"detail": "En feil oppstod under behandlingen av forespørselen."},
status=status.HTTP_400_BAD_REQUEST
status=status.HTTP_400_BAD_REQUEST,
)

def update(self, request, pk):
Expand All @@ -81,7 +81,7 @@ def update(self, request, pk):
except ValueError:
return Response(
{"detail": "En feil oppstod under behandlingen av forespørselen."},
status=status.HTTP_400_BAD_REQUEST
status=status.HTTP_400_BAD_REQUEST,
)

def destroy(self, request, *args, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions app/content/serializers/event.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from django.db.models import Q
from rest_framework import serializers

from dry_rest_permissions.generics import DRYPermissionsField
Expand Down Expand Up @@ -326,6 +325,7 @@ def get_allow_photo_count(self, obj, *args, **kwargs):

def get_has_not_paid_count(self, obj, *args, **kwargs):
if obj.is_paid_event:
orders = obj.orders.filter(~Q(status=OrderStatus.SALE), event=obj).count()
return orders
registrations = obj.registrations.filter(is_on_wait=False).count()
orders = obj.orders.filter(status=OrderStatus.SALE, event=obj).count()
return registrations - orders
return 0
4 changes: 2 additions & 2 deletions app/content/views/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def upload(request):
except ValueError:
return Response(
{"detail": "En feil oppstod under behandlingen av forespørselen."},
status=status.HTTP_400_BAD_REQUEST
status=status.HTTP_400_BAD_REQUEST,
)


Expand All @@ -56,5 +56,5 @@ def delete(_request, container_name, blob_name):
except ValueError:
return Response(
{"detail": "En feil oppstod under behandlingen av forespørselen."},
status=status.HTTP_400_BAD_REQUEST
status=status.HTTP_400_BAD_REQUEST,
)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ isort
flake8
flake8-django
flake8-black
pre-commit == 3.8.0
pre-commit == 4.0.1

# Testing
# ------------------------------------------------------------------------------
Expand Down

0 comments on commit 7e0f87f

Please sign in to comment.