Skip to content

Commit

Permalink
Added environment Variables for proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeoLacruz committed Nov 25, 2023
1 parent 2b17ed3 commit 7d3eef8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion inventree_supplier_panel/supplier_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from users.models import check_user_role
import requests
import json
import os

class SupplierCartPanel(PanelMixin, SettingsMixin, InvenTreePlugin, UrlsMixin):

Expand Down Expand Up @@ -93,7 +94,12 @@ def setup_urls(self):

#------------------------------ SendRequest ------------------------------------
def SendRequest(self, Cart, Path):
if self.get_setting('PROXY_CON') != '':

proxy_con= os.getenv('PROXY_CON')
proxy_url= os.getenv('PROXY_URL')
if proxy_con and proxy_url:
Proxies = {proxy_con : proxy_url}
elif self.get_setting('PROXY_CON') != '' and self.get_setting('PROXY_URL') != '':
Proxies = {self.get_setting('PROXY_CON') : self.get_setting('PROXY_URL')}
else:
Proxies = {}
Expand Down

0 comments on commit 7d3eef8

Please sign in to comment.