def get_new_form(data): class User(object): def has_perm(self, permission): return { 'crashstats.view_pii': True, 'crashstats.view_exploitability': True, }.get(permission, False) return forms.SearchForm(self.all_fields, self.product_versions, self.current_platforms, User(), data)
def get_supersearch_form(request): platforms = list(models.Platform.objects.values_list("name", flat=True)) products = [product.name for product in productlib.get_products()] # FIXME(willkg): this hardcodes always getting Firefox versions which # seems unhelpful product_versions = utils.get_versions_for_product("Firefox") all_fields = SuperSearchFields().get() form = forms.SearchForm(all_fields, products, product_versions, platforms, request.user, request.GET) return form
def get_new_form(data): class User: def has_perm(self, permission): return { "crashstats.view_pii": True, "crashstats.view_exploitability": True, }.get(permission, False) return forms.SearchForm( self.all_fields, self.products, self.product_versions, self.platforms, User(), data, )
def get_new_form(data): return forms.SearchForm(self.current_products, self.current_versions, self.current_platforms, True, data)