def geoserver_pre_delete(instance, sender, **kwargs):
 if getattr(ogc_server_settings, 'BACKEND_WRITE_ENABLED', True):
  if (not getattr(instance, 'service', None)):
   if instance.typename:
    cascading_delete(gs_catalog, instance.typename)

def geoserver_pre_delete ( instance , sender , ** kwargs ) : if getattr ( ogc_server_settings , 'BACKEND_WRITE_ENABLED' , True ) : if ( not getattr ( instance , 'service' , None ) ) : if instance . typename : cascading_delete ( gs_catalog , instance . typename )
removes the layer from geoserver .