Skip to content
Permalink
Browse files

icon selector accepts internal icons during value validation

  • Loading branch information
LarsMichelsen committed Apr 20, 2015
1 parent 9193cd7 commit 35e7e850be7a37c9afcdd8c4e0fbd01f98bdf91b
Showing with 8 additions and 1 deletion.
  1. +8 −1 web/htdocs/valuespec.py
@@ -3367,7 +3367,14 @@ def validate_value(self, value, varprefix):
if not self._allow_empty and not value:
raise MKUserError(varprefix, _("You need to select an icon."))

if value and value not in self.available_icons():
def is_internal_icon():
if defaults.omd_root:
base_path = defaults.omd_root+"/share/check_mk/web/htdocs/images"
else:
base_path = defaults.web_dir+"/htdocs/images"
return os.path.exists(base_path+'/icon_'+value+'.png')

if value and value not in self.available_icons() and not is_internal_icon():
raise MKUserError(varprefix, _("The selected icon image does not exist."))


0 comments on commit 35e7e85

Please sign in to comment.
You can’t perform that action at this time.