def printerProfilesDelete(identifier): current_profile = printerProfileManager.get_current() if current_profile and current_profile["id"] == identifier: return make_response("Cannot delete currently selected profile: {}".format(identifier), 409) default_profile = printerProfileManager.get_default() if default_profile and default_profile["id"] == identifier: return make_response("Cannot delete default profile: {}".format(identifier), 409) printerProfileManager.remove(identifier) return NO_CONTENT
def printerProfilesDelete(identifier): current_profile = printerProfileManager.get_current() if current_profile and current_profile["id"] == identifier: abort(409, description="Cannot delete currently selected profile") default_profile = printerProfileManager.get_default() if default_profile and default_profile["id"] == identifier: abort(409, description="Cannot delete default profile") printerProfileManager.remove(identifier, trigger_event=True) return NO_CONTENT
def printerProfilesDelete(identifier): printerProfileManager.remove(identifier) return NO_CONTENT
def printerProfilesDelete(identifier): if printerProfileManager.get_current_or_default()["id"] == identifier: return make_response("Cannot delete currently selected profile: %s" % identifier, 409) printerProfileManager.remove(identifier) return NO_CONTENT