 8949464294
			
		
	
	8949464294
	
	
	
		
			
			* format files Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix pyright Signed-off-by: Jens Langhammer <jens@goauthentik.io> * revert #8367 Signed-off-by: Jens Langhammer <jens@goauthentik.io> * sigh Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
		
			
				
	
	
		
			30 lines
		
	
	
		
			844 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			844 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| """NotificationWebhookMapping API Views"""
 | |
| 
 | |
| from rest_framework.serializers import ModelSerializer
 | |
| from rest_framework.viewsets import ModelViewSet
 | |
| 
 | |
| from authentik.core.api.used_by import UsedByMixin
 | |
| from authentik.events.models import NotificationWebhookMapping
 | |
| 
 | |
| 
 | |
| class NotificationWebhookMappingSerializer(ModelSerializer):
 | |
|     """NotificationWebhookMapping Serializer"""
 | |
| 
 | |
|     class Meta:
 | |
|         model = NotificationWebhookMapping
 | |
|         fields = [
 | |
|             "pk",
 | |
|             "name",
 | |
|             "expression",
 | |
|         ]
 | |
| 
 | |
| 
 | |
| class NotificationWebhookMappingViewSet(UsedByMixin, ModelViewSet):
 | |
|     """NotificationWebhookMapping Viewset"""
 | |
| 
 | |
|     queryset = NotificationWebhookMapping.objects.all()
 | |
|     serializer_class = NotificationWebhookMappingSerializer
 | |
|     filterset_fields = ["name"]
 | |
|     ordering = ["name"]
 | |
|     search_fields = ["name"]
 |