Skip to content

Commit

Permalink
Log SpamAssassin rule updates
Browse files Browse the repository at this point in the history
  • Loading branch information
KHIT93 committed Sep 9, 2020
1 parent 230afbd commit ed799b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/spamassassin/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from rest_framework.response import Response
from django.db.models import Q
import datetime
from compliance.models import DataLogEntry

class RuleViewSet(viewsets.ModelViewSet):
queryset = Rule.objects.all()
Expand All @@ -26,6 +27,7 @@ def post_sync_rule_descriptions(self, request):
sa = RuleDescription()
sa.sync_files()
Setting.objects.update_or_create(key='sa.last_updated', defaults={'value':str(datetime.datetime.now())})
DataLogEntry.objects.log_create(None, actor=request.user, changes='SpamAssassin rule update completed')
except Exception as e:
return Response({'message' : str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
return Response({}, status=status.HTTP_204_NO_CONTENT)
Expand Down

0 comments on commit ed799b0

Please sign in to comment.