Commit Graph

89 Commits

Author SHA1 Message Date
Eric Fischer
8f0134b7e4 update_course_in_cache should retry on exceptions
Previously, retry() was never called, so the task was never retried despite
defining several retry-related variables.
2016-10-19 14:09:28 -04:00
John Eskew
3614eb2800 Move xmodule_django app to openedx.core.djangoapps 2016-10-06 14:50:40 -04:00
J. Cliff Dyer
1371739f45 Register block_structure djangoapp.
TNL-5274
2016-09-06 11:42:38 -04:00
Nimisha Asthagiri
b37d2d739a Make BlockStructure tasks more resilient against failures.
https://openedx.atlassian.net/browse/TNL-5041
2016-09-02 08:02:49 -04:00
Calen Pennington
bc20a37c2b Simplify how shards are selected in CI 2016-08-03 16:23:02 -04:00
Kevin Kim
0bf8fc4b44 Converts the dates on the dashboard, sidebar navigation, and important course dates to user specified time zone. 2016-07-05 17:45:13 +00:00
E. Kolpakov
33b3dfcc92 Converts Discussion XModule to Discussion XBlock
* Renames discussion_module to discussion_xblock
* Moves common/lib/xmodule/xmodule_discussion to openedx/core/lib/xblock_builtin/xblock_discussion
2016-06-29 06:47:04 +12:00
Nimisha Asthagiri
8513e823bc Add block_metadata_utils 2016-06-23 20:22:33 -04:00
Nimisha Asthagiri
57dde6516a Update ENABLED_CACHES values 2016-06-23 20:22:33 -04:00
Nimisha Asthagiri
f016647fef Enable Block Transformer Registry in tests 2016-06-23 20:22:31 -04:00
Eric Fischer
fdc6d91588 update_in_cache on lms worker (#12689)
This commit "undoes"a previous hotfix, and allows a cms course_publish
signal to trigger a block_structure update_course_in_cache task, which
is run on an lms worker queue.

Changes:
    -exposes ALTERNATE_QUEUE_ENVS
    -adds routing layer in celery.py
    -moves prior dev_with_worker settings file to devstack_with_worker
    -moves course_block api functionality into openedx/core/djangoapps/content/block_structure
2016-06-16 18:01:06 -04:00
Nimisha Asthagiri
7da42ec769 Hotfix: Revert block structure caching changes 2016-05-25 13:26:16 -04:00
Nimisha Asthagiri
d37499c29d Hotfix for BlockStructure data not being invalidated upon Course Publish. 2016-05-20 16:21:06 -04:00
Calen Pennington
853bfe7a36 Add a TestCase mixin for enabling caches in tests
By default, disable all caching in tests, to preserve test independence.
In order to enable caching, inherit from CacheSetupMixin, and specify
which cache configuration is needed.

[EV-32]
2016-05-04 14:51:30 -04:00
Ben Patterson
b9558a90f1 Create a 3rd explicit shard for unit tests.
More accurately, this creates a 4th shard because the
last shard is always the default.
2016-04-28 10:09:32 -04:00
Ned Batchelder
2e1238b83e Remove unused imports 2016-04-08 11:23:05 -04:00
Clinton Blackburn
1185fff1ec Added pacing field Course API
ECOM-3994
2016-03-30 14:36:43 -04:00
Toby Lawrence
85304b8b9d Make CDNifying of course over image URLs only happen for relative URLs.
We don't want to blindly assemble the base CDN URL with whatever an
image URL happens to be, since it might be an absolute URL and now the
result is a broken URL.  We take a more selective approach now.
2016-03-22 13:56:40 -04:00
Ben Patterson
c504029b39 Create a third shard for lms unit tests.
This will leverage the nose attrib plugin to allow us
to break tests apart on our build system to run
in parallel on separate nodes.
2016-03-17 12:01:42 -04:00
Kevin Falcone
631bfc08a3 Migrate correctly from scratch also
Unfortunately, instrospection.get_table_description runs
select * from course_overview_courseoverview, which of course
does not exist while django is calculating initial migrations, causing
this to fail.  Additionally, sqlite does not support information_schema,
but does not do a select * from the table.

Lift the main part of mysql's get_table_description up to the migration itself
and just inspect it directly.  Continue to call the API for sqlite.
2016-03-04 11:46:25 -05:00
Kevin Falcone
7a129b0e9f Noop the 0008 and conditional the 0009 migration
We removed a column in the same release that we removed it
from the model.  This creates a gap where the code still looks for
a column which has been dropped until the new code has been deployed.

The initial fix was to put the column back, but that creates a window
during the alterations where views will error.

This noops the 0008 migration and effectively noops 0009 unless you've
run the old migration.
2016-02-26 17:14:12 -05:00
Nimisha Asthagiri
33e47d317b Course Overview migrations fix: Readd the Facebook URL field. 2016-02-26 10:20:36 -05:00
Nimisha Asthagiri
fa8ca11d8c Remove unused Mobile Social Facebook endpoint 2016-02-18 12:12:04 -05:00
Ned Batchelder
d8b9dec51e Update this command for Django 1.8 2016-02-11 15:39:35 -05:00
Julien Paillé
ea2633d485 Fix generate_course_structure command. 2016-02-10 10:23:20 +01:00
David Ormsbee
1a5b9172d8 Allow course images to be served from the CDN.
Previously, course images on the student dashboard were always
served from the localhost, even if the CDN was enabled.
2016-02-09 16:45:18 -05:00
David Ormsbee
be25bb8aba Clear caches between tests for ModuleStoreTestCase/SharedModuleStoreTestCase
Cached values were leaking across tests, causing difficult to debug errors,
particularly when using Config Models. As part of this work, certain tests
that had query counts that relied on those values being cached needed to
be adjusted up.
2016-02-06 00:01:15 -05:00
Nimisha Asthagiri
05767b433d Collect Course Blocks on Course Publish and Management Command
MA-1368
2016-02-03 16:56:22 -05:00
David Ormsbee
c4b0c7b483 Move test_get_all_courses_by_mobile_available to CourseOverviewTestCase
It somehow ended up in CourseOverviewImageSetTestCase (merge artifact?).
2016-01-11 04:30:44 -05:00
David Ormsbee
0e70676ba7 Prevent course image thumbnail race condition.
Without this change, we'd throw a TransactionManagementError in the case
where we have a race condition and generate multiple CourseOverviewImageSets
for the same CourseOverview concurrently.
2016-01-11 04:30:35 -05:00
Nimisha Asthagiri
8e3f4e058d Update Course Catalog API to support filters 2015-12-23 12:31:31 -05:00
Robert Raposa
5e69224c32 Deprecate escaping in display_name_with_default
- Remove escaping in display_name_with_default
- Move escaped version to deprecated display_name_with_default_escaped
- Does not include any other changes to remove double-escaping

Thanks to agaylard who initiated this work:
https://github.com/edx/edx-platform/pull/10756

TNL-3425
2015-12-22 11:52:04 -05:00
David Ormsbee
88c7d58313 Modify CourseOverviews to create course image thumbnails.
Course teams occasionally upload very large files as their course
image. Before this commit, those images would be used directly in
the student's dashboard, sometimes leading to MBs worth of image
data on that page. With this commit, we now auto-generate small
and large thumbnails of configurable size. The Student Dashboard
and Course About pages will make use of this new functionality
(CourseOverview.image_urls), but the behavior of
CourseOverview.course_image_url will not change.

Note that the thumbnails are still created in the contentstore,
and sit alongside their originals.

What's included:

1. Multiple sizes, currently starting with "raw", "small", and
   "large". This falls back to the current behavior automatically in
   the case where thumbnails don't exist or this feature has been
   disabled in configuration.

2. Django admin based configuration for image sizes and whether
   to enable the functionality at all. Note that to regenerate
   images, you'd need to wipe the CourseOverviewImageSet model
   rows -- it doesn't do that automatically. This is partly because
   it's a very rare operation, and partly because I'm not entirely
   sure what the longer term invalidation strategy should be in a
   world where we might potentially have multiple themes. The
   flexible configuration was intended to allow better customization
   and theming.

3. The Course About pages also use the new thumbnail functionality,
   as an example of "large". This is in addition to the "small"
   used on the student dashboard.

Things I'm punting on for now (followup PRs welcome!):

1. Bringing the thumbnails to course discovery. A quick attempt
   to do so showed that it wasn't getting properly invalidated
   and updated when publishes happen (so the old image still showed
   up). It probably has something to do with when we do the
   re-indexing because it stores this data in elasticsearch, but
   I'm not going to chase it down right now.

2. Center-cropping. While this is a nice-to-have feature, the
   behavior in this PR is no worse than what already exists in
   master in terms of image distortion (letting the browser handle
   it).

3. Automated invalidation of the images when a new config is
   created.
2015-12-18 20:03:09 -05:00
wajeeha-khalid
e37f8ff767 Merge pull request #10905 from edx/jia/MA-1051
MA-1051 - DiscussionAPI: Remove http errors from api.py
2015-12-17 15:42:40 +05:00
Nimisha Asthagiri
67ec142259 Merge pull request #10982 from edx/course_overview/management_command
generate_course_overview management command error handling
2015-12-16 11:33:01 -05:00
wajeeha-khalid
588833ff43 MA-1051: DiscussionAPI - Removed http errors from api.py and refactored to more specific errors 2015-12-16 21:23:51 +05:00
Nimisha Asthagiri
e96e65a377 generate_course_overview management command error handling 2015-12-16 10:53:44 -05:00
Renzo Lucioni
2cee39d535 Modify Course API to filter visible courses by org
Org to filter by is provided to the Course API list view using a querystring argument. Filtering ultimately occurs at the database layer. ECOM-2761.
2015-12-14 15:32:46 -05:00
Nimisha Asthagiri
d6364312f4 Course Overview - require manual seeding of the table. 2015-12-13 23:35:46 -05:00
Nimisha Asthagiri
8289c321be Update CourseOverview for Course Catalog
Added the following fields to CourseOverview:
    announcement
    catalog_visibility
    course_video_url
    effort
    short_description

Now requires CourseOverview models for each course in the system:
    Introduced a CourseOverviewGeneratedHistory model to keep track of
    when the CourseOverview table was seeded. The seeding can be
    done preemptively by calling the generate_course_overview management
    command. Otherwise, it is lazily computed, when needed.
2015-12-10 17:15:41 -05:00
Nimisha Asthagiri
d170c92f3b Refactor course_image_url 2015-12-04 11:25:40 -05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
muhammad-ammar
8d5f153201 Merge remote-tracking branch 'origin/release' into dj18-release-merge
Conflicts:
	common/djangoapps/util/testing.py
	lms/djangoapps/instructor/views/api.py
	lms/djangoapps/teams/tests/test_views.py
	openedx/core/djangoapps/programs/models.py
	openedx/core/djangoapps/user_api/accounts/tests/test_views.py
	requirements/edx/github.txt
2015-11-18 17:53:44 +05:00
Giovanni Di Milia
64acf4846b Enforced maximum amount of students for CCX
CCX overrides course max_student_enrollments_allowed
and set it to 200 during CCX creation
2015-11-16 10:10:37 -05:00
Usman Khalid
6cb62f2697 Rebase upgrade Django to v1.8.5
Please note that this is a squshed commit and the work of:
Symbolist, macdiesel, nedbat, doctoryes, muzaffaryousaf and muhammad-ammar
2015-11-10 15:00:19 -05:00
Syed Hassan Raza
3102788bd1 Delete course entry from CourseAboutSearchIndex 2015-11-07 18:27:09 +05:00
David Ormsbee
4ac9725793 Remove foreign key constraint on CourseOverviewTab -> CourseOverview
This will allow v1 code of CourseOverview to delete entries. While
this is not a good thing in general (and future versions will ignore
entries with higher versions than they support), this is necessary
to prevent errors with the existing code in a rollback situation.
Otherwise, old code trying to delete CourseOverview entries will
fail with a foreign key constraint violation.
2015-10-20 15:30:31 -04:00
David Ormsbee
3cd348008d CourseOverview will only delete old versions of saved data.
Previously, CourseOverview would delete data for any version
that didn't match the current one. That could cause problems
during deploys, when multiple versions of CourseOverview
were active. They would overwrite each other, and that could
cause problems if the old one overwrote the new one -- in
our case, the new one created a new table with foreign key
links that the old one was unaware of, and trying to delete
it would have caused an error.
2015-10-20 15:03:50 -04:00
Matt Drayer
1eab25f292 mattdrayer/increment-edx-lint: Bump to v0.2.9 and address pylint/pep8 violations
* Fix paver violations to stablize edx-lint update
* Parens, Line2Long
* Fix missing docstrings
* Fix PEP8 issues
* Address PR feedback (thanks @nedbat!)
2015-10-19 10:11:59 -04:00
wajeeha-khalid
90fe71dbfe MA-1248 - CourseEnrollmentAPI: added discussion URL 2015-10-09 19:04:55 +05:00