|
@@ -254,13 +254,6 @@ class ServiceAllocationMixin:
|
|
|
# return qs
|
|
|
|
|
|
|
|
|
-#class ServiceDisplayMixin:
|
|
|
-# show_change_link = True
|
|
|
-#
|
|
|
-# def service(self, obj):
|
|
|
-# return format_html('<a href="{}">{}</a>', reverse('admin:services_ipresource_change', args=[obj.resource.pk]), obj)
|
|
|
-
|
|
|
-
|
|
|
class NewServiceAllocationInline(ServiceAllocationMixin, NewAllocationMixin, AllocationInline):
|
|
|
fields = ('id', 'service', 'resource', 'route',)
|
|
|
|
|
@@ -328,15 +321,6 @@ class ServicePortInline(PortInline):
|
|
|
readonly_fields = ('switch', 'port', 'up',)
|
|
|
|
|
|
|
|
|
-### Actions
|
|
|
-
|
|
|
-def ends_resource_allocation(resource, request, queryset):
|
|
|
- now = timezone.now()
|
|
|
- queryset.exclude(start__lte=now, end__isnull=False).update(end=now)
|
|
|
- # TODO: send mail
|
|
|
-ends_resource_allocation.short_description = 'Terminer les allocations sélectionnées'
|
|
|
-
|
|
|
-
|
|
|
### ModelAdmin
|
|
|
|
|
|
class ServiceAdmin(admin.ModelAdmin):
|
|
@@ -837,7 +821,6 @@ admin.site.register(ServiceType, ServiceTypeAdmin)
|
|
|
admin.site.register(Service, ServiceAdmin)
|
|
|
admin.site.register(IPPrefix, IPPrefixAdmin)
|
|
|
admin.site.register(IPResource, IPResourceAdmin)
|
|
|
-admin.site.register(IPResourceState, IPResourceStateAdmin)
|
|
|
admin.site.register(Route, RouteAdmin)
|
|
|
admin.site.register(Tunnel, TunnelAdmin)
|
|
|
admin.site.register(Antenna, AntennaAdmin)
|