Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
ee4bc424
Commit
ee4bc424
authored
Jul 17, 2013
by
ihoover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove depracated feature flag `GENERATE_RANDOM_USER_CREDENTIALS`
parent
ceacc3b4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 additions
and
45 deletions
+1
-45
cms/envs/common.py
+0
-3
common/djangoapps/student/views.py
+1
-38
lms/envs/common.py
+0
-4
No files found.
cms/envs/common.py
View file @
ee4bc424
...
...
@@ -62,9 +62,6 @@ MITX_FEATURES = {
}
ENABLE_JASMINE
=
False
# needed to use lms student app
GENERATE_RANDOM_USER_CREDENTIALS
=
False
############################# SET PATH INFORMATION #############################
PROJECT_ROOT
=
path
(
__file__
)
.
abspath
()
.
dirname
()
.
dirname
()
# /mitx/cms
...
...
common/djangoapps/student/views.py
View file @
ee4bc424
...
...
@@ -676,7 +676,7 @@ def create_account(request, post_override=None):
message
=
render_to_string
(
'emails/activation_email.txt'
,
d
)
# dont send email if we are doing load testing or random user generation for some reason
if
not
(
settings
.
GENERATE_RANDOM_USER_CREDENTIALS
or
settings
.
MITX_FEATURES
.
get
(
'AUTOMATIC_AUTH_FOR_LOAD_TESTING'
)):
if
not
(
settings
.
MITX_FEATURES
.
get
(
'AUTOMATIC_AUTH_FOR_LOAD_TESTING'
)):
try
:
if
settings
.
MITX_FEATURES
.
get
(
'REROUTE_ACTIVATION_EMAIL'
):
dest_addr
=
settings
.
MITX_FEATURES
[
'REROUTE_ACTIVATION_EMAIL'
]
...
...
@@ -905,43 +905,6 @@ def create_exam_registration(request, post_override=None):
return
HttpResponse
(
json
.
dumps
(
js
),
mimetype
=
"application/json"
)
def
get_random_post_override
():
"""
Return a dictionary suitable for passing to post_vars of _do_create_account or post_override
of create_account, with random user info.
"""
def
id_generator
(
size
=
6
,
chars
=
string
.
ascii_uppercase
+
string
.
ascii_lowercase
+
string
.
digits
):
return
''
.
join
(
random
.
choice
(
chars
)
for
x
in
range
(
size
))
return
{
'username'
:
"random_"
+
id_generator
(),
'email'
:
id_generator
(
size
=
10
,
chars
=
string
.
ascii_lowercase
)
+
"_dummy_test@mitx.mit.edu"
,
'password'
:
id_generator
(),
'name'
:
(
id_generator
(
size
=
5
,
chars
=
string
.
ascii_lowercase
)
+
" "
+
id_generator
(
size
=
7
,
chars
=
string
.
ascii_lowercase
)),
'honor_code'
:
u'true'
,
'terms_of_service'
:
u'true'
,
}
def
create_random_account
(
create_account_function
):
def
inner_create_random_account
(
request
,
post_override
=
None
):
# This logic ensures that even if we have both
# GENERATE_RANDOM_USER_CREDENTIALS and
# settings.MITX_FEATURES['AUTOMATIC_AUTH_FOR_LOAD_TESTING']
# set to true, then create_account will behave they way
# each feature for automated account generation expects
if
post_override
is
None
:
post_override
=
get_random_post_override
()
return
create_account_function
(
request
,
post_override
)
return
inner_create_random_account
# TODO (vshnayder): do we need GENERATE_RANDOM_USER_CREDENTIALS for anything?
if
settings
.
GENERATE_RANDOM_USER_CREDENTIALS
:
create_account
=
create_random_account
(
create_account
)
def
auto_auth
(
request
):
"""
Automatically logs the user in with a generated random credentials
...
...
lms/envs/common.py
View file @
ee4bc424
...
...
@@ -40,12 +40,8 @@ ENABLE_JASMINE = False
# only relevant if MITX_FEATURES['AUTOMATIC_AUTH_FOR_LOAD_TESTING'] = True
MAX_AUTO_AUTH_USERS
=
200
GENERATE_RANDOM_USER_CREDENTIALS
=
False
PERFSTATS
=
False
# # automatic_auth should turn on random_cred of it needs to
# GENERATE_RANDOM_USER_CREDENTIALS = GENERATE_RANDOM_USER_CREDENTIALS or AUTOMATIC_AUTH_FOR_LOAD_TESTING
DISCUSSION_SETTINGS
=
{
'MAX_COMMENT_DEPTH'
:
2
,
}
...
...
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