Skip to content

Commit

Permalink
Merge pull request #1036 from kartoza/check-username-directly
Browse files Browse the repository at this point in the history
patch: check username directly
  • Loading branch information
tinashechiraya authored May 22, 2024
2 parents 064053a + 98b19ba commit a5fc3a3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
4 changes: 2 additions & 2 deletions deployment/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 13 additions & 8 deletions django_project/minisass/management/commands/clean_up_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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}")
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,6 @@ const Observations: React.FC<DesktopTwoColumnscoreProps> = (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
Expand Down

0 comments on commit a5fc3a3

Please sign in to comment.