Merge branch 'devel' of github.com:foosel/OctoPrint into dev/permission
This commit is contained in:
commit
ed6bdf97d1
109 files changed
+6396
-2707
No files matched your search
@@ -112,8 +112,14 @@ def printerProfilesGet(identifier):
|
||||
@restricted_access
|
||||
@Permissions.SETTINGS.require(403)
|
||||
def printerProfilesDelete(identifier):
|
||||
if printerProfileManager.get_current_or_default()["id"] == identifier:
|
||||
return make_response("Cannot delete currently selected profile: %s" % identifier, 409)
|
||||
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
|
||||
|
||||
|
||||
Reference in new issue
Block a user