Commit Graph

488 Commits

Author SHA1 Message Date
Greg Price
0e59038c72 Add pagination to forum user profile page 2014-04-23 16:49:50 -04:00
jsa
0738b6c327 django_comment_client/forum: add test coverage for user_profile view
JIRA: FOR-496
2014-04-16 11:51:33 -04:00
Greg Price
ecf9923e96 Return 404 instead of 500 for missing forum thread
Also show a more specific error message in the front end. This change
only has an effect if using cs_comments_service commit 1d71330 or later.
2014-04-10 13:17:58 -04:00
Calen Pennington
ec1b056d82 Use requests library utility method for getting json results 2014-03-28 11:37:43 -04:00
Calen Pennington
d4db0ee7e4 Remove unused methods from comment_client 2014-03-28 11:37:43 -04:00
Jay Zoldak
c5a7911b87 Fix pylint disable pragmas that were pep8 violations 2014-03-20 10:18:40 -04:00
Usman Khalid
021e6f5b45 Merge pull request #2970 from edx/usman/lms2194-discussion-forum-unicode-error
Replaces print statement in django_comment_client with unicode log.debug.
2014-03-20 17:36:57 +05:00
Usman Khalid
8b6e3b4422 Replaces print statement in django_comment_client with unicode log.debug.
LMS-2194
2014-03-19 19:36:55 +05:00
Greg Price
88b0a0a4c1 Merge pull request #2960 from edx/gprice/FOR-499
Do not allow students to pin/unpin forum threads
2014-03-18 14:03:56 -04:00
Greg Price
f56de914d5 Do not allow students to pin/unpin forum threads
The wrong permission was being checked for pinning/unpinning, so a
sufficiently clever student could pin and unpin threads.

JIRA: FOR-499
2014-03-12 17:58:31 -04:00
Greg Price
834692b2e3 Add missing import
JIRA: FOR-523
2014-03-11 14:51:08 -04:00
zubiar-arbi
cf47b6b670 assign default forum role 'Student' to user on course recreate with same name STUD-1140
STUD-1140
2014-02-26 15:40:44 +05:00
jsa
4c5336e809 django_comment_client: add unit test for (sub)comment deletion.
JIRA: FOR-470
2014-02-20 13:35:26 -05:00
Greg Price
c321ce50f6 Add unit test for updating forum comment 2014-02-18 17:37:03 -05:00
Greg Price
9ae6bb0b73 Check for forum data errors in LMS
Some messages generated by the comments service are not readily
translated because they come from third-party libraries. Thus, we plan
to try to avoid showing any comments service generated message to the
user. This check preempts the only end-user-visible CS-generated error
message that we are presently aware of.
2014-02-13 15:44:57 -05:00
Greg Price
1c188c9f89 Send language preference to the comments service 2014-02-12 15:25:34 -05:00
Greg Price
5841d460f0 Clean up usage of CS API key 2014-02-12 15:24:30 -05:00
Ned Batchelder
1bd213beba Remove unused imports. 2014-02-10 14:07:50 -05:00
Greg Price
bc0ca63f7e Avoid requesting unnecessary thread responses
The front-end code for rendering a thread always makes an AJAX request
for the resopnses, regardless of how the thread was accessed (directly
by URL or by selecting it from the thread list). Previously, when
a user accessed a thread directly by URL, the LMS would initially
request the thread from the comments service with responses, but that
response data was never actually used. Now, the responses are not
fetched with that initial query.
2014-02-07 10:50:59 -05:00
Greg Price
4e1c595472 Merge pull request #2377 from edx/gprice/forum-thread-pagination
Add pagination of responses to forum threads
2014-02-03 08:55:20 -08:00
Chris Rossi
0a1ed11daa Make mako template lookups pluggable.
This code adds the ability to add Mako template lookup directories on
the fly, allowing third party add-ons to contribute their own Mako templates.
A new API function for registering Mako templates is introduced::

    from edxmako import add_lookup

    add_lookup('main', '/path/to/templates')

    # Or, specify a package to lookup using pkg_resources.  This will
    # add the 'templates' directory inside the current package:
    add_lookup('main', 'templates', package=__name__)
2014-01-31 13:55:36 -05:00
Jay Zoldak
bc30addfb9 Unicode changes to support QRF
fixing unit tests

fixing merge error

fixing xqueue submission issue with unicode url (trial 0.1)

fixing fotmats as commented upon

removing yaml file language selection

Unicode changes to support QRF

removed unnecessary pass in modulestore/init.py

fixing merge error

fixing fotmats as commented upon

removing yaml file language selection

fixing pep8 violations

- fixing pylint violations

pylint violation

fixing line spaces and formats

ignore pylint E1101

remove empty line

fixing pylint violations

 pep8 violations

bulk mail unicode/decode

fix migration error

fix pep8 just to push again

more unicode/decode
Final changes to comments and error messages.
2014-01-30 16:20:36 -05:00
Greg Price
fba6f2ebb2 Allow LMS to do forum thread response pagination
The relevant parameters and data are merely passed through between the
front end and comments service.
2014-01-30 13:58:46 -05:00
Sef Kloninger
5546a7fe12 improve error reporting for reload_forum_users cmd
If this management command fails it's tough to figure out why without
seeing the text from the exception.  Luckily comment service does
return useful feedback, we just have to show it.  This one-line
change just add the exception text to the error message.

Before (with spurrious debug msgs removed):

    sefk@util1:~$ ./manage.sh reload_forum_users Anthonyhubendurance
    update user info to discussion failed for user with id: Anthonyhubendurance

After:

    sefk@util1:~$ ./manage.sh reload_forum_users Anthonyhubendurance
    update user info to discussion failed for user with id: Anthonyhubendurance, error=u'["Email is already taken"]'

No unit testing (sorry) added since this doesn't have coverage
already, and it's just a simple error case.
2014-01-30 08:36:23 -08:00
Greg Price
f75a7e08cd Internationalize forums mustache templates 2014-01-21 15:57:57 -05:00
jsa
dfa4a03daa i18n: externalize strings in discussion forums templates and python code.
JIRA: FOR-398, FOR-399
2014-01-15 14:26:22 -05:00
Greg Price
5b2ff9b21a Add unit tests for non-ASCII forum content 2014-01-14 13:56:36 -05:00
Greg Price
a1dc49cc9b Remove defunct forum post tagging code 2014-01-14 13:03:56 -05:00
David Baumgold
5d63cd0eb0 Merge pull request #2094 from edx/db/change-section-start-date
Set default section start date to Jan 1, 2030
2014-01-07 13:10:29 -08:00
David Baumgold
ce4b130113 Set default section start date to Jan 1, 2030
STUD-1072
2014-01-07 15:46:15 -05:00
Greg Price
c44e527615 Remove unused forums-related cruft 2014-01-06 16:59:30 -05:00
David Baumgold
3d2ad59c51 Merge pull request #1907 from edx/db/whitespace-fixes
whitespace-only changes
2013-12-13 11:40:54 -08:00
cahrens
df09e99ad1 Create explicit Locations.
Part of STUD-1030
2013-12-12 14:37:00 -05:00
David Baumgold
28f22393bf whitespace-only changes 2013-12-10 11:45:49 -05:00
Greg Price
cec58f885b Remove forum user profile moderator toggle button
This button has been broken for at least a year, so the code has
suffered from bit rot and should be reimplmemented if the feature is
necessary in the short term (which is unlikely since it has been broken
for so long).
2013-12-09 10:23:21 -05:00
David Baumgold
d15391fdfa Update factory_boy to 2.2.1 2013-12-05 15:50:49 -05:00
David Baumgold
f3f4af8087 settings.MITX_FEATURES => settings.FEATURES 2013-12-03 15:34:55 -05:00
David Baumgold
8eff442752 mitxmako => edxmako 2013-12-03 14:15:09 -05:00
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