Andriy Kornatskyy avatar Andriy Kornatskyy committed 00053bf

Fix issue when model and property has the same name while rendering message widget.

Comments (0)

Files changed (1)

src/wheezy/html/ext/lexer.py

             'class': self.error_class(name, class_)}
 
     def dropdown(self, expr, params, expr_filter):
-        """
+        """ HTML element select.
         """
         return self.select_helper(expr, params, expr_filter, '')
 
     def listbox(self, expr, params, expr_filter):
-        """
+        """ HTML element select of type multiple.
         """
         return self.select_helper(
             expr, params, expr_filter, ' multiple="multiple"')
         class_ = kwargs.pop('class', '')
         if class_:
             class_ = ' ' + self.expression(class_)
-        if expr.startswith(name):
+        if '.' not in expr:
             name = '__ERROR__'
             kwargs['class'] = '"error-message' + class_ + '"'
         else:
     def message_helper(self, expr, params, expr_filter, msg_class):
         """ General info message.
         """
-        name = parse_name(expr)
         args, kwargs = parse_params(params)
         class_ = kwargs.pop('class', '')
         if class_:
             class_ = ' ' + self.expression(class_)
-        if expr.startswith(name):
+        if '.' not in expr:
             class_ = '-message' + class_
         kwargs['class'] = '"' + msg_class + class_ + '"'
         return self.MESSAGE % {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.