From 6c401ec9a4b909f8dae55aafa402393da74feace Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Thu, 18 Jul 2024 17:58:58 -0400 Subject: [PATCH 01/12] Update sql_keywords.json --- breathecode/sql_keywords.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/breathecode/sql_keywords.json b/breathecode/sql_keywords.json index 3ee964657..8fbb49c7e 100644 --- a/breathecode/sql_keywords.json +++ b/breathecode/sql_keywords.json @@ -415,7 +415,6 @@ "RECHECK", "CATALOG", "CHARACTERS", - "KEY", "LISTEN", "OTHERS", "SQLERROR", @@ -524,7 +523,6 @@ "FOREIGN", "DOUBLE", "UNDER", - "LATERAL", "SYSTEM", "VACUUM", "PREPARED", From 540a0c56598565012a33d2c1bbb86743a7a9ac3f Mon Sep 17 00:00:00 2001 From: gustavomm19 Date: Fri, 19 Jul 2024 09:56:37 +0000 Subject: [PATCH 02/12] fix consumables redirection link --- .../tests/urls_shortner/tests_meet_slug_service_slug.py | 2 +- breathecode/utils/decorators/consume.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/breathecode/mentorship/tests/urls_shortner/tests_meet_slug_service_slug.py b/breathecode/mentorship/tests/urls_shortner/tests_meet_slug_service_slug.py index 713f6dc2e..5a11870bb 100644 --- a/breathecode/mentorship/tests/urls_shortner/tests_meet_slug_service_slug.py +++ b/breathecode/mentorship/tests/urls_shortner/tests_meet_slug_service_slug.py @@ -1863,7 +1863,7 @@ def test_with_mentor_profile__academy_available_as_saas__flag_eq_true__mentee_wi template_data["URL_BACK"] = "https://4geeks.com/choose-program" template_data["BUTTON"] = "Get more consumables" template_data["LINK"] = ( - f"https://4geeks.com/checkout?mentorship_service_set={base.mentorship_service_set.slug}&token={base.token.key}" + f"https://4geeks.com/checkout/mentorship/{base.mentorship_service_set.slug}?token={base.token.key}" ) expected = render("with-consumer-not-enough-consumables", data=template_data, academy=None) diff --git a/breathecode/utils/decorators/consume.py b/breathecode/utils/decorators/consume.py index 328f8407f..66688bdc7 100644 --- a/breathecode/utils/decorators/consume.py +++ b/breathecode/utils/decorators/consume.py @@ -152,12 +152,10 @@ def render_html_error(request, kwargs, service, e): renovate_consumables["btn_label"] = "Get more consumables" if service == "join_mentorship": renovate_consumables["btn_url"] = ( - f"https://4geeks.com/checkout?mentorship_service_set={mentorship_service_set}&token={token}" + f"https://4geeks.com/checkout/mentorship/{mentorship_service_set}?token={token}" ) elif service == "event_join": - renovate_consumables["btn_url"] = ( - f"https://4geeks.com/checkout?event_type_set={event_type_set}&token={token}" - ) + renovate_consumables["btn_url"] = f"https://4geeks.com/checkout/event/{event_type_set}?token={token}" else: if service == "join_mentorship" or service == "event_join": e = "You must get a plan in order to access this service" From 3624a974145bf490a6ed08dbe245a9c9eb09c498 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Mon, 22 Jul 2024 16:16:09 +0000 Subject: [PATCH 03/12] Change paymentmethod description length --- .../0052_alter_paymentmethod_description.py | 18 ++++++++++++++++++ breathecode/payments/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 breathecode/payments/migrations/0052_alter_paymentmethod_description.py diff --git a/breathecode/payments/migrations/0052_alter_paymentmethod_description.py b/breathecode/payments/migrations/0052_alter_paymentmethod_description.py new file mode 100644 index 000000000..bbbd9a319 --- /dev/null +++ b/breathecode/payments/migrations/0052_alter_paymentmethod_description.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.7 on 2024-07-22 16:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("payments", "0051_service_consumer"), + ] + + operations = [ + migrations.AlterField( + model_name="paymentmethod", + name="description", + field=models.CharField(help_text="Description of the payment method", max_length=480), + ), + ] diff --git a/breathecode/payments/models.py b/breathecode/payments/models.py index 6af7233b1..88b36c11c 100644 --- a/breathecode/payments/models.py +++ b/breathecode/payments/models.py @@ -1774,7 +1774,7 @@ class PaymentMethod(models.Model): academy = models.ForeignKey(Academy, on_delete=models.CASCADE, blank=True, null=True, help_text="Academy owner") title = models.CharField(max_length=120, null=False, blank=False) is_credit_card = models.BooleanField(default=False, null=False, blank=False) - description = models.CharField(max_length=255, help_text="Description of the payment method") + description = models.CharField(max_length=480, help_text="Description of the payment method") third_party_link = models.URLField( blank=True, null=True, default=None, help_text="Link of a third party payment method" ) From d80df24c7393b1c38da67f26ff3150f18af171a7 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:20:06 -0400 Subject: [PATCH 04/12] Update provisioning_invoice.html --- breathecode/provisioning/templates/provisioning_invoice.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/breathecode/provisioning/templates/provisioning_invoice.html b/breathecode/provisioning/templates/provisioning_invoice.html index 773544d8d..6ca4ebde1 100644 --- a/breathecode/provisioning/templates/provisioning_invoice.html +++ b/breathecode/provisioning/templates/provisioning_invoice.html @@ -188,7 +188,7 @@
{{ consumption.kind.product_name }} ({{ consumption.kind.sku }}) {% if consumption.status_text %} - - + show errors {% endif %} From 41b2bb2e61024acbe38a2d9e88f4cbc8c6acf66e Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Thu, 25 Jul 2024 02:04:58 +0000 Subject: [PATCH 05/12] fixed search when looking for a slug and added searching an asset by github URL --- breathecode/admissions/views.py | 11 ++++++----- breathecode/assignments/views.py | 5 ++--- breathecode/marketing/views.py | 10 +++++----- breathecode/media/views.py | 5 ++--- breathecode/registry/utils.py | 14 +++++++++++++- breathecode/registry/views.py | 33 +++++++++++++++++++++----------- 6 files changed, 50 insertions(+), 28 deletions(-) diff --git a/breathecode/admissions/views.py b/breathecode/admissions/views.py index 8f3003565..e382ed02c 100644 --- a/breathecode/admissions/views.py +++ b/breathecode/admissions/views.py @@ -5,6 +5,7 @@ from django.contrib.auth.models import AnonymousUser, User from django.db.models import FloatField, Max, Q, Value from django.utils import timezone +from slugify import slugify from rest_framework import status from rest_framework.decorators import permission_classes from rest_framework.exceptions import ParseError, PermissionDenied, ValidationError @@ -188,7 +189,7 @@ def get_public_syllabus(request, id=None): like = request.GET.get("like", None) if like is not None: - items = items.filter(Q(name__icontains=like) | Q(slug__icontains=like)) + items = items.filter(Q(name__icontains=like) | Q(slug__icontains=slugify(like))) serializer = GetSyllabusSmallSerializer(items, many=True) return Response(serializer.data) @@ -271,7 +272,7 @@ def get(self, request, id=None): syllabus_slug_like = request.GET.get("syllabus_slug_like", "") if syllabus_slug_like: - items = items.filter(syllabus_version__syllabus__slug__icontains=syllabus_slug_like) + items = items.filter(syllabus_version__syllabus__slug__icontains=slugify(syllabus_slug_like)) plan = request.GET.get("plan", "") if plan == "true": @@ -1144,7 +1145,7 @@ def get(self, request, cohort_id=None, academy_id=None): like = request.GET.get("like", None) if like is not None: - items = items.filter(Q(name__icontains=like) | Q(slug__icontains=like)) + items = items.filter(Q(name__icontains=like) | Q(slug__icontains=slugify(like))) items = handler.queryset(items) serializer = GetCohortSerializer(items, many=True) @@ -1202,7 +1203,7 @@ def get(self, request, cohort_id=None, academy_id=None): like = request.GET.get("like", None) if like is not None: - items = items.filter(Q(name__icontains=like) | Q(slug__icontains=like)) + items = items.filter(Q(name__icontains=like) | Q(slug__icontains=slugify(like))) items = handler.queryset(items) serializer = GetCohortSerializer(items, many=True) @@ -1514,7 +1515,7 @@ def get(self, request, syllabus_id=None, syllabus_slug=None, academy_id=None): like = request.GET.get("like", None) if like is not None: - items = items.filter(Q(name__icontains=like) | Q(slug__icontains=like)) + items = items.filter(Q(name__icontains=like) | Q(slug__icontains=slugify(like))) items = handler.queryset(items) serializer = GetSyllabusSerializer(items, many=True) diff --git a/breathecode/assignments/views.py b/breathecode/assignments/views.py index 71478de4a..758a128dd 100644 --- a/breathecode/assignments/views.py +++ b/breathecode/assignments/views.py @@ -1,7 +1,7 @@ import hashlib import logging import os - +from slugify import slugify from adrf.views import APIView from asgiref.sync import sync_to_async from circuitbreaker import CircuitBreakerError @@ -15,7 +15,6 @@ from rest_framework.decorators import api_view from rest_framework.exceptions import PermissionDenied from rest_framework.response import Response -from slugify import slugify import breathecode.activity.tasks as tasks_activity import breathecode.assignments.tasks as tasks @@ -474,7 +473,7 @@ def get(self, request, cohort_id, academy_id): like = request.GET.get("like", None) if like is not None and like != "undefined" and like != "": - items = items.filter(Q(associated_slug__icontains=like) | Q(title__icontains=like)) + items = items.filter(Q(associated_slug__icontains=slugify(like)) | Q(title__icontains=like)) # tasks from users that belong to these cohort student = request.GET.get("student", None) diff --git a/breathecode/marketing/views.py b/breathecode/marketing/views.py index 6e2eb557d..dbbbff317 100644 --- a/breathecode/marketing/views.py +++ b/breathecode/marketing/views.py @@ -7,7 +7,7 @@ import re from datetime import timedelta from urllib import parse - +from slugify import slugify import pandas as pd import pytz from circuitbreaker import CircuitBreakerError @@ -486,7 +486,7 @@ def get(self, request, format=None, academy_id=None): like = request.GET.get("like", None) if like is not None: - items = items.filter(slug__icontains=like) + items = items.filter(slug__icontains=slugify(like)) status = request.GET.get("status", None) if status is not None: @@ -550,7 +550,7 @@ def get(self, request, format=None, academy_id=None): like = request.GET.get("like", None) if like is not None: - items = items.filter(Q(slug__icontains=like) | Q(name__icontains=like)) + items = items.filter(Q(slug__icontains=slugify(like)) | Q(name__icontains=like)) status = request.GET.get("status", None) if status is not None: @@ -635,7 +635,7 @@ def get(self, request, format=None, academy_id=None): like = request.GET.get("like", None) if like is not None: - utms = utms.filter(slug__icontains=like) + utms = utms.filter(slug__icontains=slugify(like)) types = request.GET.get("type", None) if types is not None: @@ -969,7 +969,7 @@ def get(self, request, slug=None, academy_id=None): like = request.GET.get("like", None) if like is not None: - items = items.filter(slug__icontains=like) + items = items.filter(slug__icontains=slugify(like)) page = self.paginate_queryset(items, request) serializer = ShortlinkSmallSerializer(page, many=True) diff --git a/breathecode/media/views.py b/breathecode/media/views.py index 307eed743..cbabf01a5 100644 --- a/breathecode/media/views.py +++ b/breathecode/media/views.py @@ -3,7 +3,7 @@ import hashlib import logging import os - +from slugify import slugify import requests from circuitbreaker import CircuitBreakerError from django.db.models import Q @@ -15,7 +15,6 @@ from rest_framework.response import Response from rest_framework.views import APIView from rest_framework.viewsets import ViewSet -from slugify import slugify from breathecode.authenticate.actions import get_user_language from breathecode.media.models import Category, Media, MediaResolution @@ -123,7 +122,7 @@ def get(self, request, academy_id=None): like = request.GET.get("like") if like: - items = items.filter(Q(name__icontains=like) | Q(slug__icontains=like)) + items = items.filter(Q(name__icontains=like) | Q(slug__icontains=slugify(like))) items = handler.queryset(items) serializer = GetMediaSerializer(items, many=True) diff --git a/breathecode/registry/utils.py b/breathecode/registry/utils.py index 714863664..6d6bd8c00 100644 --- a/breathecode/registry/utils.py +++ b/breathecode/registry/utils.py @@ -1,5 +1,5 @@ import logging - +import re import requests from bs4 import BeautifulSoup @@ -9,6 +9,18 @@ logger = logging.getLogger(__name__) +def is_url(value): + url_pattern = re.compile( + r"^(https?://)?" # optional http or https scheme + r"(([A-Za-z0-9-]+\.)+[A-Za-z]{2,})" # domain name + r"(:\d+)?" # optional port + r"(\/[-A-Za-z0-9@:%._\+~#=]*)*" # path + r"(\?[;&A-Za-z0-9%_.~+=-]*)?" # query string + r"(#[-A-Za-z0-9_]*)?$" # fragment locator + ) + return re.match(url_pattern, value) is not None + + def get_urls_from_html(html_content): soup = BeautifulSoup(html_content, features="lxml") urls = [] diff --git a/breathecode/registry/views.py b/breathecode/registry/views.py index f7c04622b..0495c6412 100644 --- a/breathecode/registry/views.py +++ b/breathecode/registry/views.py @@ -2,7 +2,7 @@ import os import re from pathlib import Path - +from slugify import slugify import requests from circuitbreaker import CircuitBreakerError from django.core.validators import URLValidator @@ -26,6 +26,7 @@ from breathecode.utils.api_view_extensions.api_view_extensions import APIViewExtensions from breathecode.utils.i18n import translation from breathecode.utils.views import render_message +from .utils import is_url from capyc.rest_framework.exceptions import ValidationException from .actions import ( @@ -263,7 +264,7 @@ def get(self, request, academy_id=None): like = request.GET.get("like", None) if like is not None and like != "undefined" and like != "": - items = items.filter(Q(slug__icontains=like) | Q(title__icontains=like)) + items = items.filter(Q(slug__icontains=slugify(like)) | Q(title__icontains=like)) if slug := request.GET.get("slug"): lookup["slug__in"] = slug.split(",") @@ -632,9 +633,14 @@ def get(self, request, asset_slug=None): like = request.GET.get("like", None) if like is not None: - items = items.filter( - Q(slug__icontains=like) | Q(title__icontains=like) | Q(assetalias__slug__icontains=like) - ) + if is_url(like): + items = items.filter(Q(readme_url__icontains=like) | Q(url__icontains=like)) + else: + items = items.filter( + Q(slug__icontains=slugify(like)) + | Q(title__icontains=like) + | Q(assetalias__slug__icontains=slugify(like)) + ) if "slug" in self.request.GET: asset_type = self.request.GET.get("asset_type", None) @@ -940,9 +946,14 @@ def get(self, request, asset_slug=None, academy_id=None): like = request.GET.get("like", None) if like is not None: - items = items.filter( - Q(slug__icontains=like) | Q(title__icontains=like) | Q(assetalias__slug__icontains=like) - ) + if is_url(like): + items = items.filter(Q(readme_url__icontains=like) | Q(url__icontains=like)) + else: + items = items.filter( + Q(slug__icontains=slugify(like)) + | Q(title__icontains=like) + | Q(assetalias__slug__icontains=slugify(like)) + ) if "asset_type" in self.request.GET: param = self.request.GET.get("asset_type") @@ -1433,7 +1444,7 @@ def get(self, request, category_slug=None, academy_id=None): like = request.GET.get("like", None) if like is not None and like != "undefined" and like != "": - items = items.filter(Q(slug__icontains=like) | Q(title__icontains=like)) + items = items.filter(Q(slug__icontains=slugify(like)) | Q(title__icontains=like)) lang = request.GET.get("lang", None) if lang is not None: @@ -1520,7 +1531,7 @@ def get(self, request, keyword_slug=None, academy_id=None): like = request.GET.get("like", None) if like is not None and like != "undefined" and like != "": - items = items.filter(Q(slug__icontains=like) | Q(title__icontains=like)) + items = items.filter(Q(slug__icontains=slugify(like)) | Q(title__icontains=like)) lang = request.GET.get("lang", None) if lang is not None and lang != "undefined" and lang != "": @@ -1612,7 +1623,7 @@ def get(self, request, cluster_slug=None, academy_id=None): like = request.GET.get("like", None) if like is not None and like != "undefined" and like != "": - items = items.filter(Q(slug__icontains=like) | Q(title__icontains=like)) + items = items.filter(Q(slug__icontains=slugify(like)) | Q(title__icontains=like)) items = items.filter(**lookup) items = handler.queryset(items) From 9127294a22e588af209cea81966c977d96f07bb4 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Thu, 25 Jul 2024 02:10:02 +0000 Subject: [PATCH 06/12] movred python vresion to 3.12.2 --- .gitpod.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 5dc45f0e9..a90620342 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -10,11 +10,13 @@ ports: tasks: - command: redis-server - init: | - python -m scripts.install + pyenv global 3.12.2 && + python -m scripts.install && gp sync-done deps - command: pipenv run celery + command: pyenv global 3.12.2 && pipenv run celery - init: gp sync-await deps command: > + pyenv global 3.12.2 && (psql -U gitpod -c 'CREATE DATABASE breathecode;' || true) && (psql -U gitpod -c 'CREATE EXTENSION unaccent;' -d breathecode || true) && pipenv run migrate && From aceba34693ba76cf0361b226ee7be7f0640ae53a Mon Sep 17 00:00:00 2001 From: jefer94 Date: Thu, 1 Aug 2024 15:09:40 -0500 Subject: [PATCH 07/12] add prints --- breathecode/events/actions.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/breathecode/events/actions.py b/breathecode/events/actions.py index 7ab67fefb..10eb0e738 100644 --- a/breathecode/events/actions.py +++ b/breathecode/events/actions.py @@ -53,9 +53,11 @@ def process_i_owe_you(i_owe_them: QuerySet[AbstractIOweYou]): and i_owe_you.selected_cohort_set.cohorts.first().academy and i_owe_you.selected_cohort_set.cohorts.first().academy not in academies ): + print(4, i_owe_you.selected_cohort_set.cohorts.first().academy) academies.append(i_owe_you.selected_cohort_set.cohorts.first().academy) if i_owe_you.selected_cohort_set and i_owe_you.selected_cohort_set.cohorts.first() not in cohorts: + print(5, i_owe_you.selected_cohort_set.cohorts.first()) cohorts.append(i_owe_you.selected_cohort_set.cohorts.first()) if ( @@ -63,6 +65,11 @@ def process_i_owe_you(i_owe_them: QuerySet[AbstractIOweYou]): and i_owe_you.selected_cohort_set.cohorts.first().syllabus_version and i_owe_you.selected_cohort_set.cohorts.first().syllabus_version.syllabus not in syllabus ): + print( + 6, + i_owe_you.selected_cohort_set.cohorts.first().syllabus_version.syllabus, + i_owe_you.selected_cohort_set.cohorts.first().academy, + ) syllabus.append( { "syllabus": i_owe_you.selected_cohort_set.cohorts.first().syllabus_version.syllabus, @@ -71,17 +78,20 @@ def process_i_owe_you(i_owe_them: QuerySet[AbstractIOweYou]): ) if i_owe_you.selected_event_type_set and i_owe_you.selected_event_type_set.academy not in academies: + print(7, i_owe_you.selected_event_type_set.academy) academies.append(i_owe_you.selected_event_type_set.academy) if ( i_owe_you.selected_mentorship_service_set and i_owe_you.selected_mentorship_service_set.academy not in academies ): + print(8, i_owe_you.selected_mentorship_service_set.academy) academies.append(i_owe_you.selected_mentorship_service_set.academy) if i_owe_you.selected_event_type_set: for event_type in i_owe_you.selected_event_type_set.event_types.all(): if event_type.id not in ids: + print(9, event_type.id) ids.append(event_type.id) syllabus = [] @@ -110,6 +120,7 @@ def process_i_owe_you(i_owe_them: QuerySet[AbstractIOweYou]): for cohort_user in cohort_users_with_syllabus: if cohort_user.cohort.syllabus_version.syllabus not in cohorts: + print(1, cohort_user.cohort.syllabus_version.syllabus, cohort_user.cohort.academy) syllabus.append( { "syllabus": cohort_user.cohort.syllabus_version.syllabus, @@ -119,10 +130,12 @@ def process_i_owe_you(i_owe_them: QuerySet[AbstractIOweYou]): for cohort_user in cohort_users: if cohort_user.cohort.academy not in cohorts: + print(2, cohort_user.cohort.academy) academies.append(cohort_user.cohort.academy) for cohort_user in cohort_users: if cohort_user.cohort not in cohorts: + print(3, cohort_user.cohort) cohorts.append(cohort_user.cohort) process_i_owe_you(subscriptions) From 03d0b6247f4cbbcaba46817cd4510369da263159 Mon Sep 17 00:00:00 2001 From: jefer94 Date: Thu, 1 Aug 2024 15:53:33 -0500 Subject: [PATCH 08/12] add more prints --- breathecode/events/actions.py | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/breathecode/events/actions.py b/breathecode/events/actions.py index 10eb0e738..b9380deb1 100644 --- a/breathecode/events/actions.py +++ b/breathecode/events/actions.py @@ -141,6 +141,49 @@ def process_i_owe_you(i_owe_them: QuerySet[AbstractIOweYou]): process_i_owe_you(subscriptions) process_i_owe_you(plan_financings) + print( + -11, + [ + { + "id": x.id, + "slug": x.slug, + "name": x.name, + } + for x in academies + ], + ) + + print( + -22, + [ + { + "id": x.id, + "slug": x.slug, + "name": x.name, + } + for x in cohorts + ], + ) + + print( + -33, + [ + { + "syllabus": { + "id": x["syllabus"].id, + "slug": x["syllabus"].slug, + "name": x["syllabus"].name, + }, + "academy": { + "id": x["academy"].id, + "slug": x["academy"].slug, + "name": x["academy"].name, + }, + } + for x in cohorts + ], + ) + return academies, cohorts, syllabus, ids def my_events(): From 8f07fbe0901339ada032d805a794441a94f56e29 Mon Sep 17 00:00:00 2001 From: jefer94 Date: Thu, 1 Aug 2024 16:07:09 -0500 Subject: [PATCH 09/12] fix a bug --- breathecode/events/actions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/breathecode/events/actions.py b/breathecode/events/actions.py index b9380deb1..e7745c43e 100644 --- a/breathecode/events/actions.py +++ b/breathecode/events/actions.py @@ -180,7 +180,7 @@ def process_i_owe_you(i_owe_them: QuerySet[AbstractIOweYou]): "name": x["academy"].name, }, } - for x in cohorts + for x in syllabus ], ) From 4cc700242ab1bd2be5ce4c69c04a511d6144c921 Mon Sep 17 00:00:00 2001 From: jefer94 Date: Fri, 2 Aug 2024 02:07:46 -0500 Subject: [PATCH 10/12] add prints --- breathecode/events/actions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/breathecode/events/actions.py b/breathecode/events/actions.py index e7745c43e..12d096b4d 100644 --- a/breathecode/events/actions.py +++ b/breathecode/events/actions.py @@ -48,6 +48,7 @@ def get_related_resources(): def process_i_owe_you(i_owe_them: QuerySet[AbstractIOweYou]): for i_owe_you in i_owe_them: + print("get in", i_owe_you) if ( i_owe_you.selected_cohort_set and i_owe_you.selected_cohort_set.cohorts.first().academy @@ -183,6 +184,8 @@ def process_i_owe_you(i_owe_them: QuerySet[AbstractIOweYou]): for x in syllabus ], ) + print(-44, subscriptions) + print(-55, plan_financings) return academies, cohorts, syllabus, ids From 48bcf5b4d78447082fd1c51df4520a05df729977 Mon Sep 17 00:00:00 2001 From: Alejandro Sanchez Date: Thu, 15 Aug 2024 15:30:01 -0400 Subject: [PATCH 11/12] Update views.py --- breathecode/registry/views.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/breathecode/registry/views.py b/breathecode/registry/views.py index 0495c6412..6def5526e 100644 --- a/breathecode/registry/views.py +++ b/breathecode/registry/views.py @@ -696,6 +696,13 @@ def get(self, request, asset_slug=None): param = self.request.GET.get("exclude_category") items = items.exclude(category__slug__in=[p for p in param.split(",") if p]) + if "authors_username" in self.request.GET: + au = self.request.GET.get("authors_username", "").split(",") + query = Q() + for username in au: + query |= Q(authors_username__icontains=username) + items = items.exclude(~query) + items = items.filter(query, **lookup, visibility="PUBLIC").distinct() items = handler.queryset(items) From 03b008f8d58487f836dab26361907347274c1824 Mon Sep 17 00:00:00 2001 From: Jeferson De Freitas Pinto Date: Mon, 19 Aug 2024 20:16:24 -0500 Subject: [PATCH 12/12] Update README.md --- README.md | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index dbe112fa3..89ac7f2ed 100644 --- a/README.md +++ b/README.md @@ -13,23 +13,8 @@ - Docker Hub - - - - Linter - - - - Test - - - - Test + Checks