Skip to content
Snippets Groups Projects
Commit e0437f70 authored by Carlos Vega's avatar Carlos Vega
Browse files

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

parent 7536a235
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 #7293 failed
...@@ -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,7 @@ class OfficeAvailabilityTest(TestCase): ...@@ -24,7 +25,7 @@ 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', office_availability = OfficeAvailability(u'{} {}'.format('âêîôûŵŷäëïöüẅÿà', 'èìòùẁỳáéíóúẃýćńóśźżąę'),
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