Skip to content

Commit

Permalink
Merge branch 'dbca-wa:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
shibaken authored Feb 27, 2024
2 parents 1f6352e + c3d5d65 commit 0cda05b
Show file tree
Hide file tree
Showing 10 changed files with 247 additions and 207 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN apt-get upgrade -y
RUN apt-get install --no-install-recommends -y curl wget git libmagic-dev gcc binutils libproj-dev gdal-bin python3 python3-setuptools python3-dev python3-pip tzdata cron rsyslog gunicorn
RUN apt-get install --no-install-recommends -y libpq-dev patch libreoffice
RUN apt-get install --no-install-recommends -y postgresql-client mtr htop vim npm sudo
RUN apt-get install --no-install-recommends -y bzip2
RUN apt-get install --no-install-recommends -y bzip2 unzip
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN apt remove -y libnode-dev
RUN apt remove -y libnode72
Expand Down
1 change: 1 addition & 0 deletions cron
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
30 2 * * * root eval $(grep -v '^#' /etc/.cronenv | xargs -d "\n" -I {} echo export \"{}\" ) && cd /app && python manage_ml.py cron_tasks > logs/run_cron_tasks.log 2>&1
*/10 * * * * root eval $(grep -v '^#' /etc/.cronenv | xargs -d "\n" -I {} echo export \"{}\" ) && cd /app && python manage_ml.py export_to_mooring_booking_cron_task > logs/run_export_to_mooring_booking_cron_task.log 2>&1
10 4 * * * root eval $(grep -v '^#' /etc/.cronenv | xargs -d "\n" -I {} echo export \"{}\" ) && cd /app && python manage_ml.py runcrons > logs/runcrons.log 2>&1
30 3 * * 4 root eval $(grep -v '^#' /etc/.cronenv | xargs -d "\n" -I {} echo export \"{}\" ) && cd /app && python manage_ml.py clearsessions > logs/clearsessions.log 2>&1
2 changes: 1 addition & 1 deletion mooringlicensing/components/approvals/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def get_mooring_licence_authorised_users(self, obj):
"lodgement_number": approval.lodgement_number,
"vessel_name": (
approval.current_proposal.vessel_details.vessel.latest_vessel_details.vessel_name
if approval.current_proposal.vessel_details else ''
if approval.current_proposal and approval.current_proposal.vessel_details else ''
),
"holder": approval.submitter_obj.get_full_name(),
"mobile": approval.submitter_obj.mobile_number,
Expand Down
4 changes: 3 additions & 1 deletion mooringlicensing/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
from mooringlicensing import settings

from ledger_api_client import utils as ledger_api_utils

def mooringlicensing_processor(request):
ret_dict = {}

web_url = request.META.get('HTTP_HOST', None)
lt = ledger_api_utils.get_ledger_totals()

return {
'public_url': web_url,
# 'template_group': 'parksv2',
'template_group': 'ria',
'LEDGER_UI_URL': f'{settings.LEDGER_UI_URL}',
'LEDGER_SYSTEM_ID': f'{settings.LEDGER_SYSTEM_ID}',
'ledger_totals': lt,
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def handle(self, *args, **options):
path = options['path']
t_start = time.time()

mlr=MooringLicenceReader('PersonDets.txt', 'MooringDets.txt', 'VesselDets.txt', 'UserDets.txt', 'ApplicationDets.txt','annual_admissions_booking_report.csv', path='shared/clean/clean_22Dec2022/')
mlr=MooringLicenceReader('PersonDets.txt', 'MooringDets.txt', 'VesselDets.txt', 'UserDets.txt', 'ApplicationDets.txt','annual_admissions_booking_report.csv', path=path)

mlr.create_users()
mlr.create_vessels()
Expand Down
1 change: 1 addition & 0 deletions mooringlicensing/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ def show_toolbar(request):
CRON_CLASSES = [
'mooringlicensing.cron.OracleIntegrationCronJob',
'appmonitor_client.cron.CronJobAppMonitorClient',
'ledger_api_client.cron.CronJobLedgerTotals',
]

# Is licence holder allowed to operate
Expand Down
2 changes: 2 additions & 0 deletions mooringlicensing/templates/mooringlicensing/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
{% endif %}
{% if is_mooringlicensing_admin_user or request.user.is_superuser or is_payment_officer %}
<li><a class="dropdown-item" href="{{ LEDGER_UI_URL }}/reports?system_id={{ LEDGER_SYSTEM_ID }} ">Financial Reports</a></li>
<li><a class="dropdown-item" href="{{ LEDGER_UI_URL }}/ledger/payments/oracle/failed-transactions?system_id={{ LEDGER_SYSTEM_ID }}">Failed Refunds {% if ledger_totals.total_failed > 0 %}<span class="badge badge-danger">{{ ledger_totals.total_failed }}</span>{% endif %}</li>

{% endif %}
{% if is_mooringlicensing_admin_user or request.user.is_superuser %}
<li role="separator" class="divider"></li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

{% if is_mooringlicensing_admin_user or request.user.is_superuser or is_payment_officer %}
<li><a class="dropdown-item" href="{{ LEDGER_UI_URL }}/reports?system_id={{ LEDGER_SYSTEM_ID }} ">Financial Reports</a></li>
<li><a class="dropdown-item" href="{{ LEDGER_UI_URL }}/ledger/payments/oracle/failed-transactions?system_id={{ LEDGER_SYSTEM_ID }}">Failed Refunds {% if ledger_totals.total_failed > 0 %}<span class="badge bg-danger">{{ ledger_totals.total_failed }}</span>{% endif %}</li>
{% endif %}
4 changes: 4 additions & 0 deletions mooringlicensing/utils/export_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ def clean(srcpath='/home/jawaidm/Documents/ML_Excel/Lotus_Notes_extracts', outpa
'''
from mooringlicensing.utils.export_clean import clean
clean()
or
clean(srcpath='/var/www/ml_seg/mooringlicensing/utils/csv/clean_06Feb2024', outpath='/var/www/ml_seg/mooringlicensing/utils/csv/clean')
'''
logger.info(f'srcpath: {srcpath}')
logger.info(f'outpath: {outpath}')
Expand Down
Loading

0 comments on commit 0cda05b

Please sign in to comment.