Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMASCH
scheduling-system
Commits
a03bf648
Commit
a03bf648
authored
4 years ago
by
Jacek Lebioda
Browse files
Options
Downloads
Patches
Plain Diff
fix: more fix attempts
parent
419fbd17
No related branches found
No related tags found
1 merge request
!261
Python3 translation
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
smash/web/redcap_connector.py
+13
-5
13 additions, 5 deletions
smash/web/redcap_connector.py
smash/web/tests/functions.py
+3
-2
3 additions, 2 deletions
smash/web/tests/functions.py
smash/web/utils.py
+3
-1
3 additions, 1 deletion
smash/web/utils.py
with
19 additions
and
8 deletions
smash/web/redcap_connector.py
+
13
−
5
View file @
a03bf648
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
smash/web/tests/functions.py
+
3
−
2
View file @
a03bf648
...
...
@@ -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
():
...
...
This diff is collapsed.
Click to expand it.
smash/web/utils.py
+
3
−
1
View file @
a03bf648
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment