Skip to content

Commit

Permalink
Merge pull request #840 from xzzy/master
Browse files Browse the repository at this point in the history
Version updates
  • Loading branch information
xzzy committed Mar 5, 2021
2 parents b4acc32 + 4d7de25 commit 12036bf
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sudo: false
language: python
cache: pip
python:
- "3.5"
- "3.8"
addons:
postgresql: "9.6"
services:
Expand Down
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Prepare the base environment.
FROM ubuntu:18.04 as builder_base_ledgergw
FROM ubuntu:20.04 as builder_base_ledgergw
MAINTAINER asi@dbca.wa.gov.au
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Australia/Perth
Expand All @@ -9,7 +9,8 @@ RUN apt-get clean
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install --no-install-recommends -y wget git libmagic-dev gcc binutils libproj-dev gdal-bin python3 python3-setuptools python3-dev python3-pip tzdata cron rsyslog
RUN apt-get install --no-install-recommends -y libpq-dev
RUN apt-get install --no-install-recommends -y libpq-dev patch
RUN apt-get install --no-install-recommends -y postgresql-client mtr htop vim ssh
RUN ln -s /usr/bin/python3 /usr/bin/python && \
ln -s /usr/bin/pip3 /usr/bin/pip
RUN pip install --upgrade pip
Expand All @@ -20,9 +21,13 @@ COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt \
# Update the Django <1.11 bug in django/contrib/gis/geos/libgeos.py
# Reference: https://stackoverflow.com/questions/18643998/geodjango-geosexception-error
&& sed -i -e "s/ver = geos_version().decode()/ver = geos_version().decode().split(' ')[0]/" /usr/local/lib/python3.6/dist-packages/django/contrib/gis/geos/libgeos.py \
#&& sed -i -e "s/ver = geos_version().decode()/ver = geos_version().decode().split(' ')[0]/" /usr/local/lib/python3.6/dist-packages/django/contrib/gis/geos/libgeos.py \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/* /var/tmp/*

COPY libgeos.py.patch /app/
RUN patch /usr/local/lib/python3.8/dist-packages/django/contrib/gis/geos/libgeos.py /app/libgeos.py.patch
RUN rm /app/libgeos.py.patch

# Install the project (ensure that frontend projects have been built prior to this step).
FROM python_libs_ledgergw
COPY timezone /etc/timezone
Expand Down
4 changes: 1 addition & 3 deletions cron
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#*/2 * * * * root export $(grep -v '^#' /etc/.cronenv | xargs -d '\n') && python /app/manage_ledgergw.py test_email >> /tmp/test_email.log 2>&1
#
*/1 * * * * root eval $(grep -v '^#' /etc/.cronenv | xargs -d "\n" -I {} echo export \"{}\" ) && echo "testing" >> /tmp/cron.log
0 4 * * * root eval $(grep -v '^#' /etc/.cronenv | xargs -d "\n" -I {} echo export \"{}\" ) && python /app/manage_ledgergw.py collectbpay /mnt/external/CommBiz_WildlifeLicensing 2>&1 | logger -t wl_collectbpay

0 4 * * * root eval $(grep -v '^#' /etc/.cronenv | xargs -d "\n" -I {} echo export \"{}\" ) && python /app/manage_ledgergw.py collectbpay /mnt/external/CommBiz_WildlifeLicensing 2>&1 | logger -t wl_collectbpay
14 changes: 13 additions & 1 deletion ledger/accounts/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,20 @@ class AddressTest(TestCase):

def setUp(self):
super(AddressTest, self).setUp()
self.user = get_ddf(EmailUser, dob='1970-01-01')
get_ddf(Country, iso_3166_1_a2='AU')
self.address1 = get_ddf(Address, country='AU')
country = Country.objects.get(iso_3166_1_a2='AU')

self.address1 = Address.objects.create(
line1 = 'PO Box 12121',
line2 = '61 Adelaide Tce',
line3 = '',
#line4 = 'East Perth',
state = 'WA',
postcode = '6004',
country = country,
user = self.user
)

def test_prop_join_fields(self):
"""Test the Address join_fields property
Expand Down
2 changes: 1 addition & 1 deletion ledger/payments/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class BpointTransactionAdmin(admin.ModelAdmin):
'last_digits',
'is_test'
)
list_display = ('created','settlement_date','txn_number','receipt_number','crn1','action','amount','approved','is_test')
list_display = ('created','settlement_date','txn_number','receipt_number','crn1','action','amount','approved','is_test','integrity_check')
search_fields = ('created','amount','crn1')

def has_delete_permission(self,*args,**kwargs):
Expand Down
2 changes: 1 addition & 1 deletion ledgergw/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# URL Patterns
urlpatterns = [
#url(r'^admin/', admin.site.urls),
url(r'^admin/', admin.site.urls),
url(r'^ledgergw/remote/user/(?P<ledgeremail>.+)/(?P<apikey>.+)/', api.user_info),
url(r'^ledgergw/remote/userid/(?P<userid>[0-9]+)/(?P<apikey>.+)/', api.user_info_id),
url(r'^ledgergw/remote/user-search/(?P<apikey>.+)/', api.user_info_search),
Expand Down
11 changes: 11 additions & 0 deletions libgeos.py.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- /root/libgeos.py 2020-09-17 06:41:59.294023811 +0000
+++ /root/dev/parkstay_bs/venv/lib/python3.8/site-packages/django/contrib/gis/geos/libgeos.py 2020-09-17 06:42:26.265807788 +0000
@@ -190,7 +190,7 @@
is a release candidate (and what number release candidate), and the C API
version.
"""
- ver = geos_version().decode()
+ ver = geos_version().decode().strip()
m = version_regex.match(ver)
if not m:
raise GEOSException('Could not parse version info string "%s"' % ver)
13 changes: 8 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Django<1.12.0
Django==1.11.29
django-extensions==1.9.8
git+https://github.com/dbca-wa/dpaw-utils.git@0.3a16#egg=dpaw-utils
git+https://github.com/django-oscar/django-oscar.git@17a1f6b17aba19e3c0b095e90acc654d463e0cf9#egg=django-oscar
git+https://github.com/dbca-wa/dpaw-utils.git@0.4.2#egg=dpaw-utils
git+https://github.com/django-oscar/django-oscar.git@8a3288da439cc2a878f44ae5c5101043e658d2a2#egg=django-oscar
social-auth-app-django==2.1.0
git+https://github.com/scottp-dpaw/social-core.git@email_fix#egg=social-auth-core
coverage==4.3.1
Expand All @@ -13,11 +13,12 @@ django-braces>=1.8.1
django-datatables-view==1.13.0
django-reversion==3.0.0
django-reversion-compare==0.8.6
git+https://github.com/bruth/django-preserialize.git@11f9e822250ea3374d5cfba477a00ca886689d9f#egg=django-preserialize
git+https://github.com/xzzy/django-preserialize.git#egg=django-preserialize
#django-countries==3.4.1
django-countries==6.1.2
django-cron==0.5.0
django-dynamic-fixture==1.9.1
#django-dynamic-fixture==1.9.1
django-dynamic-fixture==3.1.1
openpyxl==2.4.8
datapackage==0.8.1
jsontableschema==0.10.1
Expand Down Expand Up @@ -46,3 +47,5 @@ dj-static==0.0.6
mixer==6.1.3
django-dirtyfields==1.3.1
dj-database-url==0.5.0
phonenumbers==8.12.15
django-treebeard==4.3.1

0 comments on commit 12036bf

Please sign in to comment.