Beispiel #1
0
 def favorites(self):
     call_favorites = helper.gather_favorites()
     favorites = helper.gather_favorites(True)
     restrict_regions, regions = helper.check_for_product_regions()
     feedback_form = forms.SubmitFeedback()
     return render_template('favorites.html',
                            api_calls=call_favorites,
                            favorites=favorites,
                            restrict_regions=restrict_regions,
                            testing=False,
                            regions=regions,
                            using_favorites=True,
                            feedback_form=feedback_form)
Beispiel #2
0
 def favorites(self):
     call_favorites = helper.gather_favorites()
     favorites = helper.gather_favorites(True)
     restrict_regions, regions = helper.check_for_product_regions()
     feedback_form = forms.SubmitFeedback()
     return render_template(
         'favorites.html',
         api_calls=call_favorites,
         favorites=favorites,
         restrict_regions=restrict_regions,
         testing=False,
         regions=regions,
         using_favorites=True,
         feedback_form=feedback_form
     )
Beispiel #3
0
    def index(self, product, testing=None):
        testing_calls = False
        if testing is not None:
            testing_calls = True

        found_product = self.retrieve_product(product)
        if type(found_product) is str:
            flash("Product not found, please check the URL and try again")
            return redirect("/")

        api_calls = helper.gather_api_calls(found_product, testing_calls, found_product.get_sorted_groups())
        restrict_regions, regions = helper.check_for_product_regions(found_product)
        favorites = helper.gather_favorites(True)
        temp_groups = found_product.get_sorted_groups()
        temp_groups.insert(0, "")
        feedback_form = forms.SubmitFeedback()
        return render_template(
            "product_front.html",
            api_calls=api_calls,
            api_settings=found_product,
            api_groups=temp_groups,
            regions=regions,
            title=found_product.title,
            api_process="/%s/api/call/process" % product,
            testing=testing_calls,
            require_region=found_product.require_region,
            restrict_regions=restrict_regions,
            favorites=favorites,
            feedback_form=feedback_form,
        )
Beispiel #4
0
    def index(self, product, testing=None):
        testing_calls = False
        if testing is not None:
            testing_calls = True

        found_product = self.retrieve_product(product)
        if type(found_product) is str:
            flash('Product not found, please check the URL and try again')
            return redirect('/')

        if not found_product.active:
            flash('Product is not active and cannot be used at this time')
            return redirect('/')

        api_calls = helper.gather_api_calls(found_product, testing_calls,
                                            found_product.get_sorted_groups())
        restrict_regions, regions = helper.check_for_product_regions(
            found_product)
        favorites = helper.gather_favorites(True)
        temp_groups = found_product.get_sorted_groups()
        temp_groups.insert(0, '')
        feedback_form = forms.SubmitFeedback()
        return render_template('product_front.html',
                               api_calls=api_calls,
                               api_settings=found_product,
                               api_groups=temp_groups,
                               regions=regions,
                               title=found_product.title,
                               api_process='/%s/api/call/process' % product,
                               testing=testing_calls,
                               require_region=found_product.require_region,
                               restrict_regions=restrict_regions,
                               favorites=favorites,
                               feedback_form=feedback_form)
Beispiel #5
0
    def index(self, product, testing=None):
        testing_calls = False
        if testing is not None:
            testing_calls = True

        found_product = self.retrieve_product(product)
        if type(found_product) is str:
            flash('Product not found, please check the URL and try again')
            return redirect('/')

        if not found_product.active:
            flash('Product is not active and cannot be used at this time')
            return redirect('/')

        api_calls = helper.gather_api_calls(
            found_product,
            testing_calls,
            found_product.get_sorted_groups()
        )
        restrict_regions, regions = helper.check_for_product_regions(
            found_product
        )
        favorites = helper.gather_favorites(True)
        temp_groups = found_product.get_sorted_groups()
        temp_groups.insert(0, '')
        feedback_form = forms.SubmitFeedback()
        return render_template(
            'product_front.html',
            api_calls=api_calls,
            api_settings=found_product,
            api_groups=temp_groups,
            regions=regions,
            title=found_product.title,
            api_process='/%s/api/call/process' % product,
            testing=testing_calls,
            require_region=found_product.require_region,
            restrict_regions=restrict_regions,
            favorites=favorites,
            feedback_form=feedback_form
        )