diff --git a/deployment/docker/entrypoint.sh b/deployment/docker/entrypoint.sh index 30053e63e..27fa2b8e0 100755 --- a/deployment/docker/entrypoint.sh +++ b/deployment/docker/entrypoint.sh @@ -62,8 +62,8 @@ psql -d "${DJANGO_DB}" -p 5432 -U "${POSTGRES_USER}" -h "${DATABASE_HOST}" -c "U # echo 'Running tests.' # Drop test DB if exists -# psql -d "${DJANGO_DB}" -p 5432 -U "${POSTGRES_USER}" -h "${DATABASE_HOST}" -c "DROP DATABASE IF EXISTS test_${DJANGO_DB};" -# python manage.py test +psql -d "${DJANGO_DB}" -p 5432 -U "${POSTGRES_USER}" -h "${DATABASE_HOST}" -c "DROP DATABASE IF EXISTS test_${DJANGO_DB};" +python manage.py test psql -d "${DJANGO_DB}" -p 5432 -U "${POSTGRES_USER}" -h "${DATABASE_HOST}" -f /home/web/django_project/webmapping/sql/observation.sql diff --git a/django_project/minisass/management/commands/clean_up_db.py b/django_project/minisass/management/commands/clean_up_db.py index 79702a726..2483345ef 100644 --- a/django_project/minisass/management/commands/clean_up_db.py +++ b/django_project/minisass/management/commands/clean_up_db.py @@ -15,6 +15,7 @@ from django.contrib.sites.models import Site from django.db.models import F, Count, Q from django.db.models.functions import TruncDate +import logging class Command(BaseCommand): @@ -118,11 +119,15 @@ def send_notification_email(self, user): 'user': user, 'login_url': login_url, }) - send_mail( - subject, - message, - settings.CONTACT_US_RECEPIENT_EMAIL, - [user.email], - fail_silently=False, - html_message=message, - ) + try: + send_mail( + subject, + message, + settings.CONTACT_US_RECEPIENT_EMAIL, + [user.email], + fail_silently=False, # Log the error instead of failing silently + html_message=message, + ) + except Exception as e: + logger = logging.getLogger(__name__) + logger.error(f"Failed to send notification email to {user.email}: {e}") diff --git a/django_project/minisass_frontend/src/components/Observations/index.tsx b/django_project/minisass_frontend/src/components/Observations/index.tsx index 5eee7e05e..83fa1375a 100644 --- a/django_project/minisass_frontend/src/components/Observations/index.tsx +++ b/django_project/minisass_frontend/src/components/Observations/index.tsx @@ -99,13 +99,6 @@ const Observations: React.FC = (props) => { size="txtRalewayBold18Green800" > {( - props?.organisation.length > 35 || - props?.usernamejimtaylOne.length > 35 - ) ? ( - props?.username.length > 15 ? - `${props.username.substring(0, 15)}...` : - props.username - ) : ( props?.username.length > 23 ? `${props.username.substring(0, 20)}...` : props.username