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
Esempio n. 2
0
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
Esempio n. 3
0
def printerProfilesDelete(identifier):
	printerProfileManager.remove(identifier)
	return NO_CONTENT
Esempio n. 4
0
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
Esempio n. 6
0
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