Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wamtram2 #525

Merged
merged 11 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.source https://github.com/dbca-wa/wastd

RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y libmagic-dev gcc binutils gdal-bin proj-bin python3-dev libpq-dev gzip curl gnupg2
&& apt-get install -y memcached libmagic-dev gcc binutils gdal-bin proj-bin python3-dev libpq-dev gzip curl gnupg2

# Install the Microsoft ODBC driver for SQL Server.
# Reference: https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver16#debian18
Expand All @@ -31,16 +31,16 @@ RUN poetry config virtualenvs.create false \

# Install the project.
FROM python_libs_wastd
COPY gunicorn.py manage.py ./
COPY gunicorn.py manage.py run.sh ./
RUN chmod +x run.sh
COPY observations ./observations
COPY users ./users
COPY wastd ./wastd
COPY wamtram ./wamtram
COPY turtle_tags ./turtle_tags
COPY wamtram2 ./wamtram2
COPY marine_mammal_incidents ./marine_mammal_incidents
RUN python manage.py collectstatic --noinput

# Run the application as the www-data user.
USER www-data
EXPOSE 8080
CMD ["gunicorn", "wastd.wsgi", "--config", "gunicorn.py"]
ENTRYPOINT [ "sh","run.sh" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Generated by Django 4.2.8 on 2023-12-14 03:55

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
("contenttypes", "0002_remove_content_type_name"),
("observations", "0012_alter_encounter_encounter_type"),
]

operations = [
migrations.AlterField(
model_name="encounter",
name="polymorphic_ctype",
field=models.ForeignKey(
editable=False,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="polymorphic_%(app_label)s.%(class)s_set+",
to="contenttypes.contenttype",
),
),
migrations.AlterField(
model_name="observation",
name="polymorphic_ctype",
field=models.ForeignKey(
editable=False,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="polymorphic_%(app_label)s.%(class)s_set+",
to="contenttypes.contenttype",
),
),
]
22 changes: 11 additions & 11 deletions observations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from django.contrib.gis.db import models
from django.template import loader
from django.urls import reverse
from django.utils.encoding import force_text
from django.utils.encoding import force_str
from django.utils.safestring import mark_safe
from django_fsm import FSMField, transition
from django_fsm_log.decorators import fsm_log_by, fsm_log_description
Expand Down Expand Up @@ -814,7 +814,7 @@ def __str__(self):
def filepath(self):
"""The path to attached file."""
try:
fpath = force_text(self.attachment.file)
fpath = force_str(self.attachment.file)
except BaseException:
fpath = None
return fpath
Expand Down Expand Up @@ -1271,8 +1271,8 @@ def short_name(self):
"-".join(
[
self.when.astimezone(tz.tzlocal()).strftime("%Y-%m-%d %H:%M %Z"),
force_text(round(self.longitude, 4)).replace(".", "-"),
force_text(round(self.latitude, 4)).replace(".", "-"),
force_str(round(self.longitude, 4)).replace(".", "-"),
force_str(round(self.latitude, 4)).replace(".", "-"),
]
)
)
Expand Down Expand Up @@ -1686,8 +1686,8 @@ def short_name(self):
"""
nameparts = [
self.when.astimezone(tz.tzlocal()).strftime("%Y-%m-%d %H:%M %Z"),
force_text(round(self.longitude, 4)).replace(".", "-"),
force_text(round(self.latitude, 4)).replace(".", "-"),
force_str(round(self.longitude, 4)).replace(".", "-"),
force_str(round(self.latitude, 4)).replace(".", "-"),
self.health,
self.maturity,
self.sex,
Expand Down Expand Up @@ -1868,8 +1868,8 @@ def short_name(self):
"""
nameparts = [
self.when.astimezone(tz.tzlocal()).strftime("%Y-%m-%d %H:%M %Z"),
force_text(round(self.longitude, 4)).replace(".", "-"),
force_text(round(self.latitude, 4)).replace(".", "-"),
force_str(round(self.longitude, 4)).replace(".", "-"),
force_str(round(self.latitude, 4)).replace(".", "-"),
self.nest_age,
self.species,
]
Expand Down Expand Up @@ -2025,7 +2025,7 @@ def __str__(self):
def filepath(self):
"""The path to attached file."""
try:
fpath = force_text(self.attachment.file)
fpath = force_str(self.attachment.file)
except BaseException:
fpath = None
return fpath
Expand Down Expand Up @@ -3117,8 +3117,8 @@ def short_name(self):
"""
nameparts = [
self.when.astimezone(tz.tzlocal()).strftime("%Y-%m-%d %H:%M %Z"),
force_text(round(self.longitude, 4)).replace(".", "-"),
force_text(round(self.latitude, 4)).replace(".", "-"),
force_str(round(self.longitude, 4)).replace(".", "-"),
force_str(round(self.latitude, 4)).replace(".", "-"),
]
if self.name is not None:
nameparts.append(self.name)
Expand Down
Loading
Loading