Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
b1169eeb
Commit
b1169eeb
authored
Jan 26, 2018
by
Jeff LaJoie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrades edx-lint to 0.5.5, disables non-sensical iterable warnings
parent
df77af18
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
11 additions
and
13 deletions
+11
-13
course_discovery/apps/api/v1/tests/test_views/test_catalogs.py
+1
-1
course_discovery/apps/course_metadata/data_loaders/marketing_site.py
+1
-1
course_discovery/apps/course_metadata/models.py
+1
-1
course_discovery/apps/course_metadata/publishers.py
+1
-1
course_discovery/apps/edx_haystack_extensions/distinct_counts/backends.py
+1
-1
course_discovery/apps/publisher/emails.py
+1
-1
course_discovery/apps/publisher/tests/test_emails.py
+1
-1
pylintrc
+3
-5
requirements/test.txt
+1
-1
No files found.
course_discovery/apps/api/v1/tests/test_views/test_catalogs.py
View file @
b1169eeb
...
...
@@ -190,7 +190,7 @@ class CatalogViewSetTests(ElasticsearchTestMixin, SerializationMixin, OAuth2Mixi
assert
response
.
data
[
'results'
]
==
self
.
serialize_catalog_course
([
course
],
many
=
True
)
# Any course appearing in the response must have at least one serialized run.
assert
len
(
response
.
data
[
'results'
][
0
][
'course_runs'
])
>
0
assert
response
.
data
[
'results'
][
0
][
'course_runs'
]
else
:
response
=
self
.
client
.
get
(
url
)
...
...
course_discovery/apps/course_metadata/data_loaders/marketing_site.py
View file @
b1169eeb
...
...
@@ -595,7 +595,7 @@ class CourseMarketingSiteDataLoader(AbstractMarketingSiteDataLoader):
def
set_subjects
(
self
,
course
,
data
):
subjects
=
self
.
_get_objects_by_uuid
(
Subject
,
data
[
'field_course_subject'
])
course
.
subjects
.
clear
()
course
.
subjects
.
add
(
*
subjects
)
course
.
subjects
.
add
(
*
subjects
)
# pylint: disable=not-an-iterable
def
set_course_run_staff
(
self
,
course_run
,
data
):
staff
=
self
.
_get_objects_by_uuid
(
Person
,
data
[
'field_course_staff'
])
...
...
course_discovery/apps/course_metadata/models.py
View file @
b1169eeb
...
...
@@ -553,7 +553,7 @@ class CourseRun(TimeStampedModel):
None if the date is unknown or enrollable paid Seats are not available.
"""
seats
=
list
(
self
.
_enrollable_paid_seats
()
.
order_by
(
'-upgrade_deadline'
))
if
len
(
seats
)
==
0
:
if
not
seats
:
# Enrollable paid seats are not available for this CourseRun.
return
None
...
...
course_discovery/apps/course_metadata/publishers.py
View file @
b1169eeb
...
...
@@ -107,7 +107,7 @@ class BaseMarketingSitePublisher:
if
response
.
status_code
==
200
:
response_json
=
response
.
json
()
if
len
(
response_json
[
'list'
])
>
0
:
if
response_json
[
'list'
]
:
return
response
.
json
()[
'list'
][
0
][
'nid'
]
else
:
return
None
...
...
course_discovery/apps/edx_haystack_extensions/distinct_counts/backends.py
View file @
b1169eeb
...
...
@@ -163,7 +163,7 @@ class DistinctCountsElasticsearchBackendWrapper(object):
Re-implements ElasticsearchSearchBackend.search from:
https://github.com/django-haystack/django-haystack/blob/v2.5.0/haystack/backends/elasticsearch_backend.py#L495
"""
if
len
(
query_string
)
==
0
:
if
not
query_string
:
return
{
'results'
:
[],
'hits'
:
0
,
'distinct_hits'
:
0
}
# NOTE (CCB): Haystack by default attempts to read/update the index mapping. Given that our mapping doesn't
...
...
course_discovery/apps/publisher/emails.py
View file @
b1169eeb
...
...
@@ -593,7 +593,7 @@ def send_email_for_seo_review(course, site):
try
:
legal_team_users
=
User
.
objects
.
filter
(
groups__name
=
LEGAL_TEAM_GROUP_NAME
)
project_coordinator
=
course
.
project_coordinator
to_addresses
=
[
user
.
email
for
user
in
legal_team_users
]
to_addresses
=
[
user
.
email
for
user
in
legal_team_users
]
# pylint: disable=not-an-iterable
from_address
=
settings
.
PUBLISHER_FROM_EMAIL
course_page_path
=
reverse
(
'publisher:publisher_course_detail'
,
kwargs
=
{
'pk'
:
course
.
id
})
...
...
course_discovery/apps/publisher/tests/test_emails.py
View file @
b1169eeb
...
...
@@ -644,7 +644,7 @@ class SEOReviewEmailTests(SiteMixin, TestCase):
self
.
assertEqual
(
len
(
mail
.
outbox
),
1
)
legal_team_users
=
User
.
objects
.
filter
(
groups__name
=
LEGAL_TEAM_GROUP_NAME
)
expected_addresses
=
[
user
.
email
for
user
in
legal_team_users
]
expected_addresses
=
[
user
.
email
for
user
in
legal_team_users
]
# pylint: disable=not-an-iterable
self
.
assertEqual
(
expected_addresses
,
mail
.
outbox
[
0
]
.
to
)
self
.
assertEqual
(
str
(
mail
.
outbox
[
0
]
.
subject
),
expected_subject
)
body
=
mail
.
outbox
[
0
]
.
body
.
strip
()
...
...
pylintrc
View file @
b1169eeb
...
...
@@ -154,6 +154,7 @@ enable =
assert-on-tuple,
attribute-defined-outside-init,
bad-staticmethod-argument,
arguments-differ,
signature-differs,
abstract-method,
super-init-not-called,
...
...
@@ -261,22 +262,20 @@ enable =
bad-option-value,
unrecognized-inline-option,
useless-suppression,
bad-inline-option,
deprecated-pragma,
disable =
arguments-differ,
bad-continuation,
invalid-name,
misplaced-comparison-constant,
file-ignored,
bad-indentation,
lowercase-l-suffix,
len-as-condition,
unused-wildcard-import,
global-statement,
no-else-return,
useless-suppression,
useless-super-delegation,
apply-builtin,
backtick,
basestring-builtin,
...
...
@@ -321,7 +320,6 @@ disable =
raising-string,
range-builtin-not-iterating,
raw_input-builtin,
redefined-outer-name,
reduce-builtin,
reload-builtin,
round-builtin,
...
...
requirements/test.txt
View file @
b1169eeb
...
...
@@ -3,7 +3,7 @@
coverage==4.2
ddt==1.1.0
edx-lint==0.5.
4
edx-lint==0.5.
5
factory-boy==2.8.1
freezegun==0.3.7
isort==4.2.5
...
...
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