Skip to content

Update views.py #2

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MusicCPR

The music education learning management system
The music education learning management system for support with the national core arts standards: create, perform, respond, and connect.

[![Built with Cookiecutter Django](https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg?logo=cookiecutter)](https://github.com/cookiecutter/cookiecutter-django/)
[![Black code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
Expand Down Expand Up @@ -158,3 +158,5 @@ Prefer to have:
## Media (sample audio) Files not working in deployed environment
1. i needed to tell s3 bucket that it should make another directory public access

## Devops
1. Black Formatter GH Action on PR
7 changes: 1 addition & 6 deletions teleband/assignments/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ class ActivityViewSet(RetrieveModelMixin, ListModelMixin, GenericViewSet):
def get_queryset(self):
# Define a subquery to get the first assignment for each activity
distinct_activity_assignments = (
Assignment.objects.filter(
enrollment__course__slug=self.kwargs["course_slug_slug"],
activity=OuterRef("id"),
)
.order_by("id", "pk")
.values("activity_id")[:1]
Assignment.objects.filter(enrollment__course__slug=self.kwargs["course_slug_slug"], activity=OuterRef("id"),).order_by("id", "pk").values("activity_id")[:1]
)

# Use the subquery to filter the main queryset
Expand Down
Loading