Commit Graph

38 Commits

Author SHA1 Message Date
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
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
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
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
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
Ned Batchelder
61b53713d2 Remove unused imports from lms, as detected by pylint. 2013-06-19 16:56:34 -04:00
Chris Dodge
a44e816877 remove_open_ended_panel_tab() -> remove_extra_paneltab(). Also, update new forums test factors to use refactored Models.py 2013-05-20 10:33:52 -04:00
Chris Dodge
fbbae44988 Merge branch 'master' of github.com:edx/edx-platform into feature/cdodge/autoprovision-forums-master
Conflicts:
	cms/djangoapps/contentstore/views/course.py
	lms/djangoapps/django_comment_client/base/views.py
	lms/djangoapps/django_comment_client/management/commands/show_permissions.py
	lms/djangoapps/django_comment_client/models.py
	lms/djangoapps/django_comment_client/tests/test_utils.py
	lms/envs/common.py
2013-05-20 10:22:36 -04:00
Jay Zoldak
71626f4ff6 Pep8 fixes of django_comment_client code 2013-05-16 15:57:34 -04:00
Your Name
c7e0b576d0 fix missing paren 2013-05-16 10:59:23 -04:00
Kevin Chugh
fa269d3c96 add flag thread django test 2013-05-16 10:59:23 -04:00
Jay Zoldak
7e63611478 Start adding view tests for discussion client. Note that these will not work unless you change your test.py to enable discussion forums. 2013-05-16 10:56:57 -04:00
Jay Zoldak
ed5ad46192 Revert "Revert "fix merge conflict""
This reverts commit 2df3fe9344.

Conflicts:
	common/static/coffee/src/discussion/utils.coffee
2013-05-16 10:29:33 -04:00
Chris Dodge
40e3410121 fix broken unit tests 2013-05-06 16:51:36 -04:00
Chris Dodge
a92910db20 update lms to reflect where comment models.py is now in common 2013-05-06 16:23:32 -04:00
Diana Huang
2df3fe9344 Revert "fix merge conflict"
This reverts commit acfd0d9fd6, reversing
changes made to e4194c99d8.
2013-04-26 12:40:35 -04:00
Your Name
0bcef4ddb7 fix merge conflicts 2013-04-22 12:54:33 -04:00
Your Name
7994e1b344 pep8 fixes 2013-04-22 12:53:30 -04:00
Jay Zoldak
be76f73107 Consolidate and upgrade factories 2013-04-18 15:11:10 -04:00
Jay Zoldak
88852c4b26 pep8 and pylint cleanup of new files 2013-04-11 14:11:30 -04:00
Jay Zoldak
442141fa04 Create a mock comment service that will listen for HTTP requests on a port 2013-04-11 14:08:32 -04:00
Calen Pennington
521843876e Make the django_comment_client return errors that can't be parsed as JSON just as simple strings when in an ajax context 2013-03-27 08:10:25 -04:00
Will Daly
e1b99186ef Removed test_permissions.py 2013-03-06 10:20:02 -05:00
Will Daly
72411a175f Added jnater's unit tests, cleaned up broken tests, ran pep8fix 2013-03-06 09:41:26 -05:00
Calen Pennington
cfae1cdf62 Pep8 autofixes 2013-02-06 11:13:50 -05:00
David Ormsbee
a3a886bd0f Revert "Add tests for django-comment-client models" (which actually had
a model change as well)

This reverts commit 053547453e.
2013-02-05 18:51:16 -05:00
David Ormsbee
119b4206a4 Revert "Fix permissions bug and add test cases for django comment client permissions."
This reverts commit e745087455.
2013-02-05 18:42:01 -05:00
Jay Zoldak
1a398980d0 Add tests for diango-comment-client middleware 2013-01-29 14:47:05 -05:00
Jay Zoldak
053547453e Add tests for django-comment-client models 2013-01-29 14:45:35 -05:00
Jay Zoldak
d81da9df4d Add tests for django comment client mustache helpers 2013-01-29 14:44:37 -05:00
Jay Zoldak
593b038780 Add tests for django-comment-client helpers 2013-01-29 14:43:28 -05:00
Jay Zoldak
1f049410ae Add tests for django comment client utils 2013-01-29 14:34:02 -05:00
Jay Zoldak
e745087455 Fix permissions bug and add test cases for django comment client permissions. 2013-01-29 14:30:15 -05:00