Skip to content
Snippets Groups Projects
Commit 5cc0b4a0 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch 'hotfix/unicode_error_office_availability' into 'master'

fixed problem with unicode characters in names when checking office availability for daily planning

See merge request NCER-PD/scheduling-system!182
parents 9a37f4c0 564b71fe
No related branches found
No related tags found
1 merge request!182fixed problem with unicode characters in names when checking office availability for daily planning
Pipeline #7338 passed
...@@ -185,7 +185,7 @@ class Worker(models.Model): ...@@ -185,7 +185,7 @@ class Worker(models.Model):
start_date = start_date.replace(hour=0, minute=0, second=0) start_date = start_date.replace(hour=0, minute=0, second=0)
end_date = start_date + datetime.timedelta(days=1) end_date = start_date + datetime.timedelta(days=1)
office_availability = OfficeAvailability('{} {}'.format(self.first_name, self.last_name), start=start_date, end=end_date) office_availability = OfficeAvailability(u'{} {}'.format(self.first_name, self.last_name), start=start_date, end=end_date)
#Appointments #Appointments
subject_appointments = AppointmentTypeLink.objects.filter(worker=self.id, date_when__gte=start_date, date_when__lte=end_date) subject_appointments = AppointmentTypeLink.objects.filter(worker=self.id, date_when__gte=start_date, date_when__lte=end_date)
......
# coding=utf-8
import logging import logging
from django.test import TestCase from django.test import TestCase
...@@ -24,7 +25,9 @@ class OfficeAvailabilityTest(TestCase): ...@@ -24,7 +25,9 @@ class OfficeAvailabilityTest(TestCase):
start_date = datetime.datetime(today.year, today.month, today.day, tzinfo=today.tzinfo) #today midnight start_date = datetime.datetime(today.year, today.month, today.day, tzinfo=today.tzinfo) #today midnight
end_date = start_date + datetime.timedelta(days=1) end_date = start_date + datetime.timedelta(days=1)
office_availability = OfficeAvailability('FirstName LastName', first_name = u'âêîôûŵŷäëïöüẅÿà'
last_name = u'èìòùẁỳáéíóúẃýćńóśźżąę'
office_availability = OfficeAvailability(u'{} {}'.format(first_name, last_name),
start=start_date, end=end_date, office_start='8:00', office_end='18:00') start=start_date, end=end_date, office_start='8:00', office_end='18:00')
#no availabilties added yet #no availabilties added yet
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment