Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
c27687f8
Commit
c27687f8
authored
Aug 16, 2017
by
Shirley He
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix dates
parent
21a21832
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
util/course-permutation-tool/generate_permutations.py
+6
-6
No files found.
util/course-permutation-tool/generate_permutations.py
View file @
c27687f8
...
...
@@ -99,10 +99,12 @@ def generate_permutations(field_args, index, results, courses_dict, field_values
# add permutation fields to dict
field_values_dict
[
permutation_option
]
=
permutation_value
# generate start and end dates
if
permutation_option
in
[
"start"
,
"end"
]:
permutation_value
=
calculate_date_value
(
permutation_value
)
field_values_dict
[
permutation_option
]
=
permutation_value
date_values
=
[
"future"
,
"past"
]
for
dates
in
date_values
:
if
dates
in
permutations_values
:
permutation_value
=
calculate_date_value
(
dates
)
field_values_dict
[
permutation_option
]
=
permutation_value
for
permutation_key
in
all_permutations_keys
:
# add audit and verify fields to dict
...
...
@@ -140,8 +142,6 @@ def calculate_date_value(date_const):
if
date_const
==
PAST_DATE
:
past
=
str
(
now
-
datetime
.
timedelta
(
days
=
60
))
return
past
if
date_const
==
None
:
return
None
except
ValueError
:
print
"Dates can only be future or past"
sys
.
exit
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment