Skip to content

Commit

Permalink
icon selector accepts internal icons during value validation
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsMichelsen committed Apr 20, 2015
1 parent 9193cd7 commit 35e7e85
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion web/htdocs/valuespec.py
Expand Up @@ -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."))


Expand Down

0 comments on commit 35e7e85

Please sign in to comment.