Skip to content

Commit

Permalink
Merge pull request #316 from intuitem/chore/remove-unused-django-temp…
Browse files Browse the repository at this point in the history
…lates

chore: Remove unused Django templates
  • Loading branch information
nas-tabchiche authored Apr 24, 2024
2 parents 296534d + cceaa12 commit 2c3327a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 183 deletions.
20 changes: 0 additions & 20 deletions backend/core/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from .views import *
from django.contrib.auth import views as auth_views
from library.views import LibraryViewSet


Expand Down Expand Up @@ -58,25 +57,6 @@
path("agg_data/", get_agg_data, name="get_agg_data"),
path("composer_data/", get_composer_data, name="get_composer_data"),
path("i18n/", include("django.conf.urls.i18n")),
path(
"password_reset/done/",
auth_views.PasswordResetDoneView.as_view(
template_name="registration/password_reset_done.html"
),
name="password_reset_done",
),
path(
"reset/done/",
auth_views.PasswordResetCompleteView.as_view(
template_name="registration/password_reset_complete.html"
),
name="password_reset_complete",
),
path(
"first_connexion/<uidb64>/<token>/",
FirstConnexionPasswordConfirmView.as_view(),
name="first_connexion_confirm",
),
]

if DEBUG:
Expand Down
72 changes: 27 additions & 45 deletions backend/core/views.py
Original file line number Diff line number Diff line change
@@ -1,63 +1,50 @@
import csv
from datetime import datetime
import importlib
import mimetypes
import re
import tempfile
from uuid import UUID
import uuid
import zipfile
from django.core.files.storage import default_storage

from django.http import FileResponse, HttpResponse
from rest_framework.parsers import FileUploadParser
from rest_framework.request import Request
from rest_framework.views import APIView
from core.forms import FirstConnexionConfirmForm, ResetConfirmForm
from core.models import AppliedControl

from core.helpers import *
from rest_framework.response import Response

from .models import *
from .serializers import *
from .permissions import IsAdministrator
from datetime import datetime
from typing import Any
from uuid import UUID

import django_filters as df
from ciso_assistant.settings import (
BUILD,
VERSION,
)

from django.contrib.auth.models import Permission
from django.core.files.storage import default_storage
from django.db import models
from django.forms import ValidationError
from django.http import FileResponse, HttpResponse
from django.middleware import csrf
from django.template.loader import render_to_string
from django.utils.functional import Promise
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import permissions, status, viewsets, filters
from iam.models import Folder, RoleAssignment, User, UserGroup
from rest_framework import filters, permissions, status, viewsets
from rest_framework.decorators import (
action,
api_view,
permission_classes,
action,
)

import csv
import importlib
import re
import uuid
from typing import Any
from uuid import UUID

import django_filters as df
from core.models import ComplianceAssessment
from core.serializers import ComplianceAssessmentReadSerializer
from django.contrib.auth.models import Permission
from django.contrib.auth.views import PasswordResetConfirmView
from django.forms import ValidationError
from django.template.loader import render_to_string
from django.utils.functional import Promise
from rest_framework.parsers import FileUploadParser
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.status import HTTP_400_BAD_REQUEST, HTTP_403_FORBIDDEN
from rest_framework.utils.serializer_helpers import ReturnDict
from rest_framework.views import APIView
from weasyprint import HTML

from core.helpers import *
from core.models import AppliedControl, ComplianceAssessment
from core.serializers import ComplianceAssessmentReadSerializer
from core.utils import RoleCodename, UserGroupCodename

from django.db import models

from iam.models import User, UserGroup, RoleAssignment, Folder
from .models import *
from .serializers import *

User = get_user_model()

Expand Down Expand Up @@ -1174,7 +1161,7 @@ def post(self, request, *args, **kwargs):
evidence.attachment = attachment
evidence.save()
return Response(status=status.HTTP_200_OK)
except Exception as e:
except Exception:
return Response(status=status.HTTP_400_BAD_REQUEST)
return Response(status=status.HTTP_400_BAD_REQUEST)

Expand Down Expand Up @@ -1402,11 +1389,6 @@ def get_build(request):
# NOTE: Important functions/classes from old views.py, to be reviewed


class FirstConnexionPasswordConfirmView(PasswordResetConfirmView):
template_name = "registration/first_connexion_confirm.html"
form_class = FirstConnexionConfirmForm


def generate_html(
compliance_assessment: ComplianceAssessment,
) -> Tuple[str, list[Evidence]]:
Expand Down
6 changes: 0 additions & 6 deletions backend/iam/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.urls import path

from core.views import FirstConnexionPasswordConfirmView

from .views import (
LoginView,
Expand All @@ -25,9 +24,4 @@
name="password-reset-confirm",
),
path("set-password/", SetPasswordView.as_view(), name="set-password"),
path(
"first_connexion/<uidb64>/<token>/",
FirstConnexionPasswordConfirmView.as_view(),
name="first_connexion_confirm",
),
]
112 changes: 0 additions & 112 deletions backend/serdes/templates/serdes/backup_restore.html

This file was deleted.

0 comments on commit 2c3327a

Please sign in to comment.