Skip to content
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
2 changes: 0 additions & 2 deletions scram/route_manager/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from netfields import rest_framework
from rest_framework import serializers
from rest_framework.fields import CurrentUserDefault
from simple_history.utils import update_change_reason

from ..models import ActionType, Client, Entry, IgnoreEntry, Route

Expand Down Expand Up @@ -96,7 +95,6 @@ def create(validated_data):
entry_instance, _ = Entry.objects.get_or_create(route=route_instance, actiontype=actiontype_instance)

logger.debug("Created entry with comment: %s", comment)
update_change_reason(entry_instance, comment)

return entry_instance

Expand Down
2 changes: 2 additions & 0 deletions scram/route_manager/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from rest_framework import status, viewsets
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.response import Response
from simple_history.utils import update_change_reason

from ..models import ActionType, Client, Entry, IgnoreEntry, WebSocketSequenceElement
from .exceptions import ActiontypeNotAllowed, IgnoredRoute, PrefixTooLarge
Expand Down Expand Up @@ -162,6 +163,7 @@ def perform_create(self, serializer):
entry.originating_scram_instance = settings.SCRAM_HOSTNAME
logger.info("Created entry: %s", entry)
entry.save()
update_change_reason(entry, comment)

@staticmethod
def find_entries(arg, active_filter=None):
Expand Down
Loading