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.
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.
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__)
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.
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.
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).
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.
Avoid recomputing course module information for every thread, which
should dramatically improve the performance of high-percentile latency
queries.
JIRA: FOR-250
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.
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.