Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #203 from open-contracting/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
jpmckinney committed Mar 28, 2021
2 parents d45df5f + d7be3aa commit 0aefef0
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 121,412 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- run: curl -s -S --retry 3 $BASEDIR/tests/install.sh | bash -
- run: sudo apt-get install shellcheck
- run: pip install -r requirements.txt black==20.8b1
- run: curl -s -S --retry 3 $BASEDIR/tests/script.sh | bash -
- run: shellcheck --exclude=SC2029 *.sh
- run: black --check .
- run: pip install -r requirements_dev.txt
- run: STANDARD_MAINTENANCE_SCRIPTS_IGNORE=flower pytest /tmp/test_requirements.py
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ static/wagtailvideos/
#public folders
media/


export/*
export/*
erl_crash.dump
3 changes: 0 additions & 3 deletions country/management/commands/import_tender_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ def handle(self, *args, **kwargs):
print(f"Fetching tender data from {excel_file_path} for country {country}")

try:
# ws = pd.read_excel(excel_file_path, sheet_name=['data'], header=None)
# ws_settings = ws['settings']
# '/Users/bigyan/UKRAINIAN DATA COVID_11.12.20.xlsx'
# Check if country exists in our database
result = Country.objects.filter(name=country).first()
country = result.name
Expand Down
4 changes: 0 additions & 4 deletions country/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ def get_equity_category(self, obj):
result.append(equity.category_name)
return result

# def get_red_flag_count(self,obj):
# red_flags = obj.red_flag.all().count()
# return red_flags

def get_supplier_name(self, obj):
return obj.supplier.supplier_name

Expand Down
13 changes: 2 additions & 11 deletions country/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def convert_local_to_usd(conversion_date, source_currency, source_value, dst_cur
f"&symbols={dst_currency}",
timeout=20,
)
# A sample response:
#
# {
# "success": true,
# "timestamp": 1387929599,
Expand Down Expand Up @@ -125,11 +127,8 @@ def save_tender_excel_to_db(excel_file_path, country, currency):
errors = []

try:
# ws_settings = pd.read_excel(excel_file_path, sheet_name='settings', header=None)
ws_data = pd.read_excel(excel_file_path, sheet_name="data", header=0, na_values=None, na_filter=False)
ws_data = ws_data.where(ws_data.notnull(), None)
# country = ws_settings[2][1]
# currency = ws_settings[2][2]
country = country
currency = currency
except:
Expand Down Expand Up @@ -159,8 +158,6 @@ def save_tender_excel_to_db(excel_file_path, country, currency):
contract_title = row["Contract title"]
contract_desc = row["Contract description"]
no_of_bidders = row["Number of bidders"] or None
# if math.isnan(no_of_bidders):
# no_of_bidders = None

buyer_id = row["Buyer ID"]
buyer_name = row["Buyer"].strip()
Expand Down Expand Up @@ -668,12 +665,6 @@ def import_tender_data_excel(excel_file_path, country, currency):

@app.task(name="local_currency_to_usd")
def local_currency_to_usd(goods_services_row_id, conversion_date, source_currency, source_values):
# source_values = {
# 'tender_value_local': row['Tender value'],
# 'award_value_local': row['Award value'],
# 'contract_value_local': row['Contract value']
# }

dst_tender_value = convert_local_to_usd(
conversion_date, source_currency, source_values["tender_value_local"], dst_currency="USD"
)
Expand Down
4 changes: 0 additions & 4 deletions country/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,6 @@ def get(self, request):
data_import_id = self.request.GET.get("data_import_id", None)
validated = self.request.GET.get("validated", None)

# file_path = settings.MEDIA_ROOT+'/documents/'+filename
# valid_file_extension = ['.xlsx','.xls',]
# file_extension= os.path.splitext(filename)[-1].lower()

if validated:
if data_import_id:
try:
Expand Down
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
ARG1=${1:-main}
ARG2=${2:-covid19\-dev}
ssh covid19-deployer@covid19admin.py.staging.yipl.com.np 'bash -s' < script.sh $ARG1 $ARG2
ssh covid19-deployer@covid19admin.py.staging.yipl.com.np 'bash -s' < script.sh "$ARG1" "$ARG2"
Loading

0 comments on commit 0aefef0

Please sign in to comment.