← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~cjwatson/launchpad/custom-widget-no-class-advice-1 into lp:launchpad

 

Review: Approve code

I really don't like this, but I can't see a better option.

Diff comments:

> 
> === modified file 'lib/lp/answers/browser/question.py'
> --- lib/lp/answers/browser/question.py	2016-01-26 15:47:37 +0000
> +++ lib/lp/answers/browser/question.py	2018-07-15 17:24:03 +0000
> @@ -603,8 +606,9 @@
>          else:
>              fields = self.form_fields
>          for field in fields:
> -            if field.__name__ in self.custom_widgets:
> -                field.custom_widget = self.custom_widgets[field.__name__]
> +            widget = getattr(self, 'custom_widget_%s' % field.__name__, None)
> +            if widget is not None:
> +                field.custom_widget = widget

Does this need to do the manual CustomWidgetFactory wrapping now?

>          return fields
>  
>      def setUpWidgets(self):


-- 
https://code.launchpad.net/~cjwatson/launchpad/custom-widget-no-class-advice-1/+merge/349631
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References