Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/breatheco-de/apiv2
Browse files Browse the repository at this point in the history
  • Loading branch information
alesanchezr committed Oct 28, 2024
2 parents 78d73e0 + 049deec commit 5cc9603
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion breathecode/admissions/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
path("syllabus/<int:syllabus_id>/version", SyllabusVersionView.as_view(), name="syllabus_id_version"),
path("syllabus/version", AllSyllabusVersionsView.as_view(), name="syllabus_version"),
path(
"syllabus/<str:syllabus_id>/version/<int:version>.csv",
"syllabus/<str:syllabus_id>/version/<str:version>.csv",
SyllabusVersionCSVView.as_view(),
name="syllabus_id_version_csv",
),
Expand Down
4 changes: 2 additions & 2 deletions breathecode/admissions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ def get(self, request, syllabus_id, version, academy_id):
f"Día {day['id']}: {day['label']}",
", ".join([lesson["title"] for lesson in day["lessons"]]),
day.get("description", ""),
", ".join([tech["title"] for tech in day["technologies"]]),
", ".join([tech["title"] if isinstance(tech, dict) else tech for tech in day["technologies"]]),
day.get("teacher_instructions", ""),
]
)
Expand All @@ -1801,7 +1801,7 @@ def get(self, request, syllabus_id, version, academy_id):
f"Day {day['id']}: {day['label']}",
", ".join([lesson["title"] for lesson in day["lessons"]]),
day.get("description", ""),
", ".join([tech["title"] for tech in day["technologies"]]),
", ".join([tech["title"] if isinstance(tech, dict) else tech for tech in day["technologies"]]),
day.get("teacher_instructions", ""),
]
)
Expand Down
4 changes: 4 additions & 0 deletions breathecode/registry/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ def get_technologies(request):
if "is_deprecated" not in request.GET or request.GET.get("is_deprecated").lower() == "false":
items = items.filter(is_deprecated=False)

like = request.GET.get("like", None)
if like is not None and like != "undefined" and like != "":
items = items.filter(Q(slug__icontains=slugify(like)) | Q(title__icontains=like))

items = items.order_by("sort_priority")

serializer = AssetTechnologySerializer(items, many=True)
Expand Down

0 comments on commit 5cc9603

Please sign in to comment.