Commit Graph

450 Commits

Author SHA1 Message Date
Calen Pennington
8ddd8c14a4 Fix pylint/pep8 errors 2013-11-08 11:08:48 -05:00
Calen Pennington
da26ae2529 Remove lms/lib from sys.path in favore of using it as the module lms.lib 2013-11-08 11:08:48 -05:00
Greg Price
c4cdb457de Remove label from forum posts by global staff
The motivation for this change is performance. The forums UI code gets
the list of users for each role and renders the staff label based on
those lists. The list for the staff role is expensive to compute because
there is no index on the is_staff attribute, and we cannot create one
because the User model is built into django.

Users with is_staff=True are still assigned the Moderator role upon
enrolling in a course, so this change will have no practical effect
except that a user who is granted staff privileges after enrolling in a
course will have to be made a Moderator in order for their posts to be
labeled.

Additionally, the UI did not use the list of users with the Student
role, so that list has been removed as well.
2013-11-01 14:16:55 -04:00
Greg Price
87e0ddf398 Fix a typo that caused an error to be raised 2013-10-30 11:18:27 -04:00
Greg Price
e6ecb6ecfe Improve performance of forum views
Avoid recomputing course module information for every thread, which
should dramatically improve the performance of high-percentile latency
queries.

JIRA: FOR-250
2013-10-28 13:04:52 -04:00
Greg Price
a7d769dfea Remove an unnecessary global
The _DISCUSSIONINFO global was originally used as a cache, but has since
lost that capability and is therefore just harmful. This is a precursor
to more refactoring that will improve the performance of the forums and
may itself provide some performance improvement because it separates the
computation done by two functions that each previously computed the
entirety of _DISCUSSIONINFO.
2013-10-28 12:57:51 -04:00
Greg Price
545701d520 Add forum utility code unit test coverage
This is in preparation for significant refactoring of the code in
question.
2013-10-28 11:58:43 -04:00
Greg Price
54ad411078 Remove unused code 2013-10-28 11:58:43 -04:00
Greg Price
7abaecd8b7 Improve forum error handling
CommentClientError now has sane subclasses that are meaningfully
distinct, and each subclass is handled appropriately. Errors raised by
the requests library are no longer handled by turning them into
CommentClientErrors, since there is no meaningful handling we can do,
and this way we will get more visibility into why errors are occurring.
Also, HTTP status codes from the comments service indicating client
error are correctly passed through to the client.
2013-10-28 11:23:06 -04:00
Greg Price
bfd2957194 Merge pull request #1457 from edx/gprice/add-newrelic-instrumentation
Add newrelic instrumentation to forum views
2013-10-22 15:23:15 -07:00
Greg Price
85f5c9328f Add newrelic instrumentation to forum views 2013-10-22 14:51:38 -04:00
Greg Price
60306f2471 Remove unnecessary login_required decorator 2013-10-22 14:51:38 -04:00
Greg Price
bd477581b6 Log all comments service requests
Logging the duration of each request will allow us to determine
whether there is a significant difference in the latency reported by
the comments service and that observed by the LMS. Each request will
be assigned a unique identifier to allow correlation of the reported
latency on each end.
2013-10-16 16:31:59 -04:00
Greg Price
17e2221604 Merge pull request #1326 from edx/gprice/cs-header-auth
Use HTTP header for comments service auth
2013-10-16 12:07:20 -07:00
Greg Price
a63d6a70d4 Require login for followed_threads
Without the login_required decorator, an error would occur, causing a
500 to be returned. This fixes FOR-155.
2013-10-11 12:28:59 -04:00
Greg Price
62cc9e77bf Use HTTP header for comments service auth
Previously, authentication was done using a URL parameter, which would
appear in various logs. Now, authentication is done more appropriately
with an HTTP header. Note that this requires cs_comments_service commit
cf39aabdd160176ebf206ca19d3ee030161a0b47 or later.
2013-10-11 12:01:44 -04:00
Greg Price
b60f5f807d Make forums endpoints return better status codes
Previously, AJAX calls would return 400, and page views and attempts
to load inline discussions would return 404 if communication with the
comments service failed. Now such problems cause a 500 status code.
2013-10-10 14:20:48 -04:00
Don Mitchell
0848360436 Merge pull request #844 from edx/dhm/editable_metadata
refactoring of platform to xblock 0.3 w/ refactoring of inheritance in the platform to a consistent representation.
2013-09-06 11:58:36 -07:00
Calen Pennington
8201b1412e Use XBlock 0.3 2013-09-06 09:45:59 -04:00
jsa
6e7965d26c update mitxmako lookup / fixes FOR-150 2013-09-05 23:23:52 -04:00
Jay Zoldak
c8949b99d1 Disable pylint violation E0611 when importing assert_* methods from nose.tools
Cleaned up files with muliline imports

Cleaned up files that do not use these imports

Misread comment
2013-08-27 16:21:33 -04:00
Giulio Gratta
44f4e7b10a refatoring tests and added to changelog 2013-08-23 12:59:14 -07:00
Giulio Gratta
4e77098859 added course level feature flag for forum alpha sorting as well as tests 2013-08-23 12:59:13 -07:00
Giulio Gratta
e0471007d8 removed sort in HTML and instead added conditional to use subcategory titles as sort_key 2013-08-23 12:59:13 -07:00
Will Daly
c680dfdd40 Merge pull request #768 from edx/will/use-mixed-modulestore-in-tests
Will/use mixed modulestore in tests
2013-08-23 08:38:09 -07:00
Your Name
a36e3b1957 CourseEnrollment no longer needed in forum/views 2013-08-21 11:06:30 -04:00
Will Daly
48c6daacb8 Removed unnecessary settings wrangling from ModuleStoreTestCase.
Modified navigation tests to use MixedModulestore
Updated factories to find editable modulestore

Updated test_submitting_problems

Updated test_tabs.py

Updated test_view_authentication

Updated test_views

Updated courseware/tests/tests.py

Updated test_masquerade

Updated test_module_render

Pylint fixes

Updated video and word cloud tests

Updated course wiki tests

Updated license and open_ended tests.
One open_ended test still failing due to Mako initialization issues

Updated staticbook

Updated django_comment_client tests

Updated instructor tests

Updated instructor task tests

Updated external_auth tests

Updated course_groups
2013-08-21 09:36:45 -04:00
Kevin Chugh
a2bbb65dcf refactor to add access control to already_existing access control routines in access.py 2013-08-20 19:42:03 -04:00
David Ormsbee
013009ea24 Let staff have access to a forum even if they're not enrolled in the course. 2013-08-19 17:27:23 -04:00
David Ormsbee
c2d1791de4 Make it so that students who are not enrolled cannot see the forum 2013-08-19 17:09:47 -04:00
David Ormsbee
3ce87583ab Shift enroll/unenroll logic to CourseEnrollment model, add is_active and mode.
Features coming down the pipe will want to be able to:
* Refer to enrollments before they are actually activated (approval step).
* See what courses a user used to be enrolled in for when they re-enroll in
  the same course, or a different run of that course.
* Have different "modes" of enrolling in a course, representing things like
  honor certificate enrollment, auditing (no certs), etc.

This change adds an is_active flag and mode (with default being "honor").
The commit is only as large as it is because many parts of the codebase were
manipulating enrollments by adding and removing CourseEnrollment objects
directly. It was necessary to create classmethods on CourseEnrollment to
encapsulate this functionality and then port everything over to using them.

The migration to add columns has been tested on a prod replica, and seems to be
fine for running on a live system with single digit millions of rows of
enrollments.
2013-08-14 13:23:06 -04:00
Kevin Chugh
e1e591f8bf address code review comments 2013-07-30 01:55:20 -04:00
Your Name
6276997180 update checkbox with get settings 2013-07-29 13:26:31 -04:00
Kevin Chugh
d95693ebb7 hook up panel to new stats service 2013-07-25 03:23:04 -04:00
Sarina Canelake
e5f97b372b pep8 fixes 2013-06-28 18:00:41 -04:00
Jay Zoldak
b1424a75b8 Add a test for 404 raised when requesting the profile page of a user that does not exist 2013-06-28 16:51:24 -04:00
Sarina Canelake
09501a62e2 Handle exception with a 404 2013-06-28 16:14:56 -04:00
Jay Zoldak
c98a77565f Make the UrlResetMixin load the urlconf after resetting it, and fix the comment client test that was leaving ENABLE_DISCUSSION_SERVICE at True 2013-06-27 11:05:09 -04:00
Ned Batchelder
57909ce1aa Fix all W0602, global used but no assignment done. 2013-06-21 17:33:23 -04:00
Ned Batchelder
df4b512b6f Change wildcard imports into specific imports 2013-06-21 17:33:06 -04:00
Ned Batchelder
e045860cb6 Pylint complains if you use string, even if you use it for what its still meant to be used for. 2013-06-21 16:35:47 -04:00
Ned Batchelder
61b53713d2 Remove unused imports from lms, as detected by pylint. 2013-06-19 16:56:34 -04:00
Jason Bau
28ae2b6346 change form of making datetime.max aware (in UTC) 2013-06-17 16:11:35 -07:00
Jason Bau
da2fda1045 Fix for broken forums due to forum entry with no start_date
modification of @jrbl's version to handle a dict with value None
2013-06-15 01:30:42 -07:00
Calen Pennington
5b8163dc9c Merge pull request #92 from edx/fix/cale/url-tests
Fix tests that vary urls.py
2013-06-12 10:47:13 -07:00
Don Mitchell
168cb306d3 Move tz_aware into connection config rather than settings.
Make django use_tz
2013-06-10 17:16:35 -04:00
Don Mitchell
d7194e6bec struct_time to datetime conversion. 2013-06-10 17:16:34 -04:00
Calen Pennington
6c24694a7c Fix tests that vary urls.py
Create a mixin class that can be used for tests that customize urls.py
to force django to reload it, so that they don't break other tests.
2013-06-10 10:56:50 -04:00
e0d
83a490c79d fixing bug noticed in production 2013-06-06 16:04:42 -04:00
Chris Dodge
9b88528b04 Merge branch 'master' of github.com:edx/edx-platform into feature/cdodge/autoprovision-forums-master 2013-05-22 13:20:49 -04:00