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

Solve bug with get-subordinates #102

Merged
merged 4 commits into from
Aug 14, 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
3 changes: 3 additions & 0 deletions INSIGHTSAPI/INSIGHTSAPI/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def str_to_bool(value: str) -> bool:
"DEFAULT_RENDERER_CLASSES": [
"rest_framework.renderers.JSONRenderer",
],
"DEFAULT_PERMISSION_CLASSES": [
"rest_framework.permissions.IsAuthenticated",
],
"DEFAULT_AUTHENTICATION_CLASSES": ("api_token.cookie_jwt.CookieJWTAuthentication",),
# "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
}
Expand Down
2 changes: 1 addition & 1 deletion INSIGHTSAPI/services/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_non_holiday(self):
def test_get_holidays(self):
"""Test that the holidays are retrieved."""
response = self.client.get("/services/holidays/2024/")
self.assertEqual(response.status_code, 200)
self.assertEqual(response.status_code, 200, response.data)
self.assertEqual(response.data, holidays.CO(years=2024).items())


Expand Down
6 changes: 4 additions & 2 deletions INSIGHTSAPI/services/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import os
import holidays
from rest_framework.response import Response
from rest_framework.decorators import api_view
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_framework.views import APIView
from django_sendfile import sendfile
from services.models import Answer
Expand Down Expand Up @@ -40,6 +41,7 @@ def get(self, request, pk):


@api_view(["POST"])
@permission_classes([AllowAny])
def send_report_ethical_line(request):
"""Send a report from the ethical line."""
if not "complaint" in request.data:
Expand Down Expand Up @@ -72,8 +74,8 @@ def trigger_error(request):
"""Trigger an error for testing purposes."""
raise Exception("Test error")


@api_view(["GET"])
@permission_classes([AllowAny])
def get_holidays(request, year):
"""Get the holidays of the year."""
try:
Expand Down
4 changes: 2 additions & 2 deletions INSIGHTSAPI/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def upper_case_name(obj):
class CustomUserAdmin(UserAdmin):
"""Custom user admin."""

readonly_fields = ["username", "area"]
readonly_fields = ["username"]

list_display = (
"username",
Expand All @@ -35,7 +35,7 @@ class CustomUserAdmin(UserAdmin):
"user_permissions",
)
fieldsets = (
("User info", {"fields": ("username", "area")}),
("User info", {"fields": ("username", ("area", "job_position"))}),
(
"Información personal",
{"fields": (("first_name", "last_name"), "email")},
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const managements = [
"Soy el fundador de C&C, desde muy joven soñaba con crear una empresa que pudiera impulsar el crecimiento económico de nuestro país y al mismo tiempo crear empleos de calidad para la gente que compartiera esta visión. Mis amigos más cercanos me definen como una persona emprendedora y visionaria.",
},
{
name: "Cesar Garzón",
name: "César Garzón",
management: "Gerente General",
image: cesarGarzon,
description:
Expand All @@ -45,7 +45,7 @@ const managements = [
"LEGAL: Prestar asesorías y representación judicial de los clientes internos y externos. \n \nRIESGO: Ejecutar procesos de Investigación y análisis mediante la implementación y desarrollo de estrategias que garanticen la mitigación del riesgo.",
},
{
name: "Angela Durán",
name: "Ángela Durán",
management: "Gerente de Planeación",
image: angelaDuran,
description:
Expand Down
3 changes: 3 additions & 0 deletions src/components/pages/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ import water from "../../images/home-carousel/water.png";
import waterConsumed from "../../images/home-carousel/water-consumed.png";
import socialMedia from "../../images/home-carousel/social-media.png";
import certification from "../../images/home-carousel/certification.png";
import politicsObjectivesQuality from "../../images/home-carousel/politics-objectives-quality.png";


const benefits = [{ image: realBenefit2, title: "Beneficio 2" }];

const homeImages = [
{ image: politicsObjectivesQuality },
{ image: certification },
{ image: points },
{ image: water },
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading