feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
from django.contrib.admin.models import LogEntry
|
2025-09-07 20:52:19 +02:00
|
|
|
from django.contrib.auth import get_user_model
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
from django.contrib.auth.decorators import login_required
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
from django.contrib.contenttypes.models import ContentType
|
2025-09-07 20:52:19 +02:00
|
|
|
from rest_framework import viewsets
|
|
|
|
from rest_framework.permissions import IsAuthenticated
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
from django.shortcuts import render, get_object_or_404
|
2025-09-07 20:52:19 +02:00
|
|
|
from .models import Risk, Control, ResidualRisk, AuditLog, Incident
|
|
|
|
from .serializers import ControlSerializer, RiskSerializer, ResidualRiskSerializer, UserSerializer, AuditSerializer, IncidentSerializer
|
|
|
|
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
User = get_user_model()
|
|
|
|
|
Add FontAwesome webfonts and update templates for Risiko Management
- Added FontAwesome webfont files: fa-brands-400.woff2, fa-regular-400.woff2, fa-solid-900.woff2, and fa-v4compatibility.woff2.
- Updated base.html to include FontAwesome stylesheet.
- Renamed the application title from "Risiko Management" to "ISO27001 Management".
- Enhanced navigation menu with dynamic active states for Dashboard, Statistics, Risks, Controls, and Incidents.
- Created new templates for dashboard, controls, incidents, risks, and statistics with breadcrumb navigation.
2025-09-07 23:07:56 +02:00
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# API
|
|
|
|
# ---------------------------------------------------------------------------
|
2025-09-07 20:52:19 +02:00
|
|
|
class RiskViewSet(viewsets.ModelViewSet):
|
|
|
|
"""
|
|
|
|
API endpoint for managing Risks.
|
|
|
|
Provides CRUD operations.
|
|
|
|
"""
|
|
|
|
queryset = Risk.objects.all()
|
|
|
|
serializer_class = RiskSerializer
|
|
|
|
permission_classes = [IsAuthenticated]
|
|
|
|
|
|
|
|
def perform_create(self, serializer):
|
|
|
|
instance = serializer.save()
|
|
|
|
instance._changed_by = self.request.user
|
|
|
|
|
|
|
|
def perform_update(self, serializer):
|
|
|
|
instance = serializer.save()
|
|
|
|
instance._changed_by = self.request.user
|
|
|
|
|
|
|
|
class ControlViewSet(viewsets.ModelViewSet):
|
|
|
|
"""
|
|
|
|
API endpoint for managing Controls.
|
|
|
|
Provides CRUD operations.
|
|
|
|
"""
|
|
|
|
queryset = Control.objects.all()
|
|
|
|
serializer_class = ControlSerializer
|
|
|
|
permission_classes = [IsAuthenticated]
|
|
|
|
|
|
|
|
def perform_create(self, serializer):
|
|
|
|
instance = serializer.save()
|
|
|
|
instance._changed_by = self.request.user
|
|
|
|
|
|
|
|
def perform_update(self, serializer):
|
|
|
|
instance = serializer.save()
|
|
|
|
instance._changed_by = self.request.user
|
|
|
|
|
|
|
|
class ResidualRiskViewSet(viewsets.ModelViewSet):
|
|
|
|
queryset = ResidualRisk.objects.all()
|
|
|
|
serializer_class = ResidualRiskSerializer
|
|
|
|
permission_classes = [IsAuthenticated]
|
|
|
|
|
|
|
|
class UserViewSet(viewsets.ReadOnlyModelViewSet):
|
|
|
|
"""
|
|
|
|
API endpoint for listing users and their responsibilities.
|
|
|
|
"""
|
|
|
|
queryset = User.objects.all()
|
|
|
|
serializer_class = UserSerializer
|
|
|
|
permission_classes = [IsAuthenticated]
|
|
|
|
|
|
|
|
def perform_create(self, serializer):
|
|
|
|
instance = serializer.save()
|
|
|
|
instance._changed_by = self.request.user
|
|
|
|
|
|
|
|
def perform_update(self, serializer):
|
|
|
|
instance = serializer.save()
|
|
|
|
instance._changed_by = self.request.user
|
|
|
|
|
|
|
|
class AuditViewSet(viewsets.ReadOnlyModelViewSet):
|
|
|
|
"""
|
|
|
|
API endpoint for view audit logging.
|
|
|
|
"""
|
|
|
|
queryset = AuditLog.objects.all()
|
|
|
|
serializer_class = AuditSerializer
|
|
|
|
permission_classes = [IsAuthenticated]
|
|
|
|
|
|
|
|
class IncidentViewSet(viewsets.ModelViewSet):
|
|
|
|
"""
|
|
|
|
API endpoint for listing incidents and its related risks.
|
|
|
|
"""
|
|
|
|
queryset = Incident.objects.all()
|
|
|
|
serializer_class = IncidentSerializer
|
|
|
|
permission_classes = [IsAuthenticated]
|
|
|
|
|
|
|
|
def perform_create(self, serializer):
|
|
|
|
instance = serializer.save(reported_by=self.request.user)
|
|
|
|
instance._changed_by = self.request.user
|
|
|
|
|
|
|
|
def perform_update(self, serializer):
|
|
|
|
instance = serializer.save()
|
|
|
|
instance._changed_by = self.request.user
|
Add FontAwesome webfonts and update templates for Risiko Management
- Added FontAwesome webfont files: fa-brands-400.woff2, fa-regular-400.woff2, fa-solid-900.woff2, and fa-v4compatibility.woff2.
- Updated base.html to include FontAwesome stylesheet.
- Renamed the application title from "Risiko Management" to "ISO27001 Management".
- Enhanced navigation menu with dynamic active states for Dashboard, Statistics, Risks, Controls, and Incidents.
- Created new templates for dashboard, controls, incidents, risks, and statistics with breadcrumb navigation.
2025-09-07 23:07:56 +02:00
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
# Web
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
@login_required
|
Add FontAwesome webfonts and update templates for Risiko Management
- Added FontAwesome webfont files: fa-brands-400.woff2, fa-regular-400.woff2, fa-solid-900.woff2, and fa-v4compatibility.woff2.
- Updated base.html to include FontAwesome stylesheet.
- Renamed the application title from "Risiko Management" to "ISO27001 Management".
- Enhanced navigation menu with dynamic active states for Dashboard, Statistics, Risks, Controls, and Incidents.
- Created new templates for dashboard, controls, incidents, risks, and statistics with breadcrumb navigation.
2025-09-07 23:07:56 +02:00
|
|
|
def dashboard(request):
|
|
|
|
return render(request, "risks/dashboard.html")
|
|
|
|
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
@login_required
|
Add FontAwesome webfonts and update templates for Risiko Management
- Added FontAwesome webfont files: fa-brands-400.woff2, fa-regular-400.woff2, fa-solid-900.woff2, and fa-v4compatibility.woff2.
- Updated base.html to include FontAwesome stylesheet.
- Renamed the application title from "Risiko Management" to "ISO27001 Management".
- Enhanced navigation menu with dynamic active states for Dashboard, Statistics, Risks, Controls, and Incidents.
- Created new templates for dashboard, controls, incidents, risks, and statistics with breadcrumb navigation.
2025-09-07 23:07:56 +02:00
|
|
|
def stats(request):
|
|
|
|
return render(request, "risks/statistics.html")
|
|
|
|
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
@login_required
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
def list_risks(request):
|
|
|
|
qs = Risk.objects.all().select_related("owner")
|
|
|
|
|
|
|
|
# GET-Parameter lesen
|
|
|
|
risk_id = request.GET.get("risk")
|
|
|
|
control_id = request.GET.get("control")
|
|
|
|
owner_id = request.GET.get("owner")
|
|
|
|
|
|
|
|
if risk_id:
|
|
|
|
qs = qs.filter(id=risk_id)
|
|
|
|
if control_id:
|
|
|
|
qs = qs.filter(controls__id=control_id)
|
|
|
|
if owner_id:
|
|
|
|
qs = qs.filter(owner_id=owner_id)
|
|
|
|
|
|
|
|
risks = qs.order_by("title").distinct()
|
|
|
|
|
|
|
|
controls = Control.objects.all().order_by("title")
|
|
|
|
owners = User.objects.filter(owned_risks__isnull=False).distinct().order_by("username")
|
|
|
|
|
|
|
|
return render(request, "risks/list_risks.html", {
|
|
|
|
"risks": risks,
|
|
|
|
"controls": controls,
|
|
|
|
"owners": owners,
|
|
|
|
})
|
|
|
|
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
@login_required
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
def show_risk(request, id):
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
risk = get_object_or_404(
|
|
|
|
Risk.objects.select_related("residual_risk", "owner").prefetch_related("controls"),
|
|
|
|
pk=id,
|
|
|
|
)
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
ct = ContentType.objects.get_for_model(Risk)
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
logs = LogEntry.objects.filter(content_type=ct, object_id=risk.pk).order_by("-action_time")
|
|
|
|
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
return render(request, "risks/item_risk.html", {"risk": risk, "logs": logs})
|
|
|
|
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
@login_required
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
def list_controls(request):
|
2025-09-09 12:00:29 +02:00
|
|
|
qs = Control.objects.all().select_related("responsible")
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
|
|
|
|
control_id = request.GET.get("control")
|
|
|
|
risk_id = request.GET.get("risk")
|
|
|
|
status = request.GET.get("status")
|
|
|
|
responsible_id = request.GET.get("responsible")
|
|
|
|
|
|
|
|
if control_id:
|
|
|
|
qs = qs.filter(id=control_id)
|
|
|
|
if risk_id:
|
2025-09-09 12:00:29 +02:00
|
|
|
qs = qs.filter(risks__id=risk_id) # FIX
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
if status:
|
|
|
|
qs = qs.filter(status=status)
|
|
|
|
if responsible_id:
|
|
|
|
qs = qs.filter(responsible_id=responsible_id)
|
|
|
|
|
2025-09-09 12:00:29 +02:00
|
|
|
controls = qs.order_by("title").distinct()
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
|
|
|
|
risks = Risk.objects.all().order_by("title")
|
|
|
|
users = User.objects.filter(responsible_controls__isnull=False).distinct().order_by("username")
|
|
|
|
|
|
|
|
return render(request, "risks/list_controls.html", {
|
|
|
|
"controls": controls,
|
|
|
|
"risks": risks,
|
|
|
|
"users": users,
|
|
|
|
"status_choices": Control.STATUS_CHOICES,
|
|
|
|
})
|
|
|
|
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
@login_required
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
def show_control(request, id):
|
|
|
|
control = get_object_or_404(Control, pk=id)
|
|
|
|
ct = ContentType.objects.get_for_model(Control)
|
|
|
|
logs = LogEntry.objects.filter(
|
|
|
|
content_type=ct,
|
|
|
|
object_id=control.pk
|
|
|
|
).order_by("-action_time")
|
|
|
|
|
|
|
|
return render(request, "risks/item_control.html", {"control": control, "logs": logs})
|
|
|
|
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
@login_required
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
def list_incidents(request):
|
2025-09-09 12:00:29 +02:00
|
|
|
qs = Incident.objects.all().select_related("reported_by").prefetch_related("related_risks")
|
|
|
|
|
|
|
|
risk_id = request.GET.get("risk")
|
|
|
|
status = request.GET.get("status")
|
|
|
|
reported_by = request.GET.get("reported_by")
|
|
|
|
|
|
|
|
if risk_id:
|
|
|
|
qs = qs.filter(related_risks__id=risk_id) # FIX
|
|
|
|
if status:
|
|
|
|
qs = qs.filter(status=status)
|
|
|
|
if reported_by:
|
|
|
|
qs = qs.filter(reported_by=reported_by)
|
|
|
|
|
|
|
|
incidents = qs.order_by("title").distinct()
|
|
|
|
|
|
|
|
risks = Risk.objects.all().order_by("title")
|
|
|
|
users = User.objects.filter(incidents__isnull=False).distinct().order_by("username") # sinnvoller
|
|
|
|
|
|
|
|
return render(request, "risks/list_incidents.html", {
|
|
|
|
"incidents": incidents,
|
|
|
|
"risks": risks,
|
|
|
|
"users": users,
|
|
|
|
"status_choices": Incident.STATUS_CHOICES,
|
|
|
|
})
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
@login_required
|
feat: Enhance Risk Management Module
- Updated Risk model to include description, created_at, and updated_at fields.
- Modified RiskSerializer to include created_at and updated_at in serialized output.
- Improved logging in signals for Risk and Control models, including serialization of values.
- Added new template tags for CIA label mapping.
- Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents.
- Implemented list and detail views for risks, controls, and incidents with filtering options.
- Enhanced CSS for better UI/UX, including breadcrumbs and table styling.
- Created new templates for displaying individual risks, controls, and incidents with detailed information.
2025-09-08 15:03:12 +02:00
|
|
|
def show_incident(request, id):
|
2025-09-09 12:00:29 +02:00
|
|
|
incident = get_object_or_404(Incident, pk=id)
|
|
|
|
ct = ContentType.objects.get_for_model(Incident)
|
|
|
|
logs = LogEntry.objects.filter(
|
|
|
|
content_type=ct,
|
|
|
|
object_id=incident.pk
|
|
|
|
).order_by("-action_time")
|
|
|
|
|
Refactor risk management application with enhanced localization, user authentication, and UI improvements
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface.
- Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity.
- Implemented gettext_lazy for translatable strings in models and choices.
- Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation.
- Added login required decorators to views for improved security.
- Introduced new CSS variables and classes for better visual representation of risk levels.
- Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact.
- Improved dashboard and statistics views with user authentication checks.
- Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users.
- Added new login and logout templates for user authentication.
- Enhanced list views for risks, controls, and incidents to include action buttons for staff users.
- Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
2025-09-09 14:25:59 +02:00
|
|
|
return render(request, "risks/item_incident.html", {"incident": incident, "logs": logs})
|