Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: take changes to prod #238

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bfportal/bfportal/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
"BACKEND": "wagtail.search.backends.database",
}
}

WAGTAILAPI_LIMIT_MAX = None
# Base URL to use when referring to full URLs within the Wagtail admin backend -
# e.g. in notification emails. Don't include '/admin' or a trailing slash
EMAIL_BACKEND = "django.core.mail.backends.dummy.EmailBackend"
Expand Down
2 changes: 1 addition & 1 deletion bfportal/core/api/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def check_query_parameters(self, queryset):
"""
Checks if all the parameters are valid,

Overriden here so that we can send custom params in our requests
Override here so that we can send custom params in our requests
see `UserFilter` class

"""
Expand Down
7 changes: 7 additions & 0 deletions bfportal/core/serializers/users.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.contrib.auth import get_user_model
from django.contrib.auth.models import User
from rest_framework import serializers

from ..models.experience import ExperiencePage
Expand All @@ -23,6 +24,7 @@ class UserModelSerializer(serializers.ModelSerializer):
"""Serializer for User model."""

social_account = serializers.SerializerMethodField()
experience_count = serializers.SerializerMethodField()

class Meta:
model = get_user_model()
Expand All @@ -31,6 +33,7 @@ class Meta:
"username",
"first_name",
"last_name",
"experience_count",
"social_account",
]
depth = 1
Expand All @@ -46,6 +49,10 @@ def get_social_account(self, obj):
# no provider internal account
return {}

def get_experience_count(self, obj: User):
"""Return the count of exp pages a user has created."""
return len(ExperiencePage.objects.filter(owner_id=obj.id))


class ProfileSerializer(serializers.ModelSerializer):
"""Serializer for Profile model."""
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.7"

services:

# Dev environment services (on local machine)
Expand Down
Loading