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
b5a0d0ce
Commit
b5a0d0ce
authored
Sep 25, 2017
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove waffle flag for showing certs on profile.
Certs are displayed by default to everyone.
parent
a2dc27e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
20 deletions
+6
-20
openedx/features/learner_profile/__init__.py
+0
-4
openedx/features/learner_profile/tests/views/test_learner_profile.py
+0
-7
openedx/features/learner_profile/views/learner_profile.py
+6
-9
No files found.
openedx/features/learner_profile/__init__.py
View file @
b5a0d0ce
...
...
@@ -8,10 +8,6 @@ from openedx.core.djangoapps.waffle_utils import WaffleFlag, WaffleFlagNamespace
# Namespace for learner profile waffle flags.
WAFFLE_FLAG_NAMESPACE
=
WaffleFlagNamespace
(
name
=
'learner_profile'
)
# Waffle flag to show achievements on the learner profile.
# TODO: LEARNER-2443: 08/2017: Remove flag after rollout.
SHOW_ACHIEVEMENTS_FLAG
=
WaffleFlag
(
WAFFLE_FLAG_NAMESPACE
,
'show_achievements'
)
# Waffle flag for showing a message about the new profile features.
# TODO: LEARNER-2554: 09/2017: Remove flag once message is no longer needed.
SHOW_PROFILE_MESSAGE
=
WaffleFlag
(
WAFFLE_FLAG_NAMESPACE
,
'show_message'
)
openedx/features/learner_profile/tests/views/test_learner_profile.py
View file @
b5a0d0ce
...
...
@@ -19,8 +19,6 @@ from util.testing import UrlResetMixin
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
...
import
SHOW_ACHIEVEMENTS_FLAG
@ddt.ddt
class
LearnerProfileViewTest
(
UrlResetMixin
,
ModuleStoreTestCase
):
...
...
@@ -133,7 +131,6 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
)
@ddt.data
(
CourseMode
.
HONOR
,
CourseMode
.
PROFESSIONAL
,
CourseMode
.
VERIFIED
)
@override_waffle_flag
(
SHOW_ACHIEVEMENTS_FLAG
,
active
=
True
)
def
test_certificate_visibility
(
self
,
cert_mode
):
"""
Verify that certificates are displayed with the correct card mode.
...
...
@@ -151,7 +148,6 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
[
'notpassing'
,
False
],
)
@ddt.unpack
@override_waffle_flag
(
SHOW_ACHIEVEMENTS_FLAG
,
active
=
True
)
def
test_certificate_status_visibility
(
self
,
status
,
is_passed_status
):
"""
Verify that certificates are only displayed for passing status.
...
...
@@ -170,7 +166,6 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
else
:
self
.
assertNotContains
(
response
,
'card certificate-card mode-{cert_mode}'
.
format
(
cert_mode
=
cert
.
mode
))
@override_waffle_flag
(
SHOW_ACHIEVEMENTS_FLAG
,
active
=
True
)
def
test_certificate_for_missing_course
(
self
):
"""
Verify that a certificate is not shown for a missing course.
...
...
@@ -184,7 +179,6 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
self
.
assertNotContains
(
response
,
'card certificate-card mode-{cert_mode}'
.
format
(
cert_mode
=
cert
.
mode
))
@ddt.data
(
True
,
False
)
@override_waffle_flag
(
SHOW_ACHIEVEMENTS_FLAG
,
active
=
True
)
def
test_no_certificate_visibility
(
self
,
own_profile
):
"""
Verify that the 'You haven't earned any certificates yet.' well appears on the user's
...
...
@@ -200,7 +194,6 @@ class LearnerProfileViewTest(UrlResetMixin, ModuleStoreTestCase):
self
.
assertNotContains
(
response
,
'You haven't earned any certificates yet.'
)
@ddt.data
(
True
,
False
)
@override_waffle_flag
(
SHOW_ACHIEVEMENTS_FLAG
,
active
=
True
)
def
test_explore_courses_visibility
(
self
,
courses_browsable
):
with
mock
.
patch
.
dict
(
'django.conf.settings.FEATURES'
,
{
'COURSES_ARE_BROWSABLE'
:
courses_browsable
}):
response
=
self
.
client
.
get
(
'/u/{username}'
.
format
(
username
=
self
.
user
.
username
))
...
...
openedx/features/learner_profile/views/learner_profile.py
View file @
b5a0d0ce
...
...
@@ -20,7 +20,7 @@ from openedx.core.djangoapps.util.user_messages import PageLevelMessages
from
openedx.core.djangolib.markup
import
HTML
,
Text
from
student.models
import
User
from
..
import
SHOW_
ACHIEVEMENTS_FLAG
,
SHOW_
PROFILE_MESSAGE
from
..
import
SHOW_PROFILE_MESSAGE
from
learner_achievements
import
LearnerAchievementsFragmentView
...
...
@@ -100,14 +100,11 @@ def learner_profile_context(request, profile_username, user_is_staff):
preferences_data
=
get_user_preferences
(
profile_user
,
profile_username
)
if
SHOW_ACHIEVEMENTS_FLAG
.
is_enabled
():
achievements_fragment
=
LearnerAchievementsFragmentView
()
.
render_to_fragment
(
request
,
username
=
profile_user
.
username
,
own_profile
=
own_profile
,
)
else
:
achievements_fragment
=
None
achievements_fragment
=
LearnerAchievementsFragmentView
()
.
render_to_fragment
(
request
,
username
=
profile_user
.
username
,
own_profile
=
own_profile
,
)
context
=
{
'own_profile'
:
own_profile
,
...
...
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