Skip to content
Snippets Groups Projects
Commit a03bf648 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

fix: more fix attempts

parent 419fbd17
No related branches found
No related tags found
1 merge request!261Python3 translation
......@@ -53,11 +53,19 @@ class RedcapVisit(object):
def different_string(string1, string2):
if string1 is None:
string1 = ""
if string2 is None:
string2 = ""
return string1.strip() != string2.strip()
if type(string1) == bytes:
s1 = string1.decode('utf8')
else:
s1 = string1
if type(string2) == bytes:
s2 = string1.decode('utf8')
else:
s2 = string2
if s1 is None:
s1 = ""
if s2 is None:
s2 = ""
return s1.strip() != s2.strip()
def date_equals(date1, date2):
......
......@@ -3,6 +3,7 @@ import logging
import os
from django.contrib.auth.models import User
from django.utils.timezone import make_aware
from web.models import Location, AppointmentType, StudySubject, Worker, Visit, Appointment, ConfigurationItem, \
Language, ContactAttempt, FlyingTeam, Availability, Subject, Study, StudyColumns, StudyNotificationParameters, \
......@@ -318,7 +319,7 @@ def create_appointment(visit=None, when=None, length=30):
length=length,
location=get_test_location(),
status=Appointment.APPOINTMENT_STATUS_SCHEDULED,
datetime_when=when)
datetime_when=make_aware(when))
def create_appointment_without_visit(when=None, length=30):
......@@ -326,7 +327,7 @@ def create_appointment_without_visit(when=None, length=30):
length=length,
location=get_test_location(),
status=Appointment.APPOINTMENT_STATUS_SCHEDULED,
datetime_when=when)
datetime_when=make_aware(when))
def create_configuration_item():
......
......@@ -3,6 +3,8 @@ from django.utils import timezone
import datetime
from datetime import timedelta
from django.utils.timezone import make_aware
from web.algorithm import VerhoeffAlgorithm, LuhnAlgorithm
def is_valid_social_security_number(number):
......@@ -23,7 +25,7 @@ def get_today_midnight_date():
today = timezone.now()
today_midnight = datetime.datetime(
today.year, today.month, today.day, tzinfo=today.tzinfo)
return today_midnight
return make_aware(today_midnight)
def get_weekdays_in_period(fromdate, todate):
......
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