-
Notifications
You must be signed in to change notification settings - Fork 4.3k
hotfix/Adam/disable accounts 2 #1298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
18c4587
Test reproducing orphaning of children
5e1f03b
Publish removes deleted children
7cfe279
Merge pull request #1348 from edx/dhm/bug_publish
brianhw 6713d6c
Work in progress.
9f871e5
Updated code fomat in test Jasmine.
a1e0f71
Added hard-coded flag to video.html that turns on/off autohiding of c…
49f4a71
Added functionality to show captions on "CC" button mousemove.
2a6418e
Updated fixtures for Jasmine tests.
e1e0cba
Added acceptance tests.
1f84053
Updated acceptance tests.
55fde6e
Updated acceptance tests.
05eb13f
Fixing JS.
3b7cc6a
Furthe addressing comments on PR.
f17a84c
Minor tweak.
c3030e8
Fixing minor typo.
0bd706b
Tidy up the code.
polesye 46abe39
Fix acceptance tests.
polesye 2e216a2
Clean up the code.
polesye 30ddaf7
Enabling showing of captions always when mouse is over CC.
4b371d4
Fixing Jean Michel access. bug.
8ec9a16
Fix parentheses so that we only pull the course modes we want.
dianakhuang 3cfaa6d
Add changelog
dianakhuang de48e4a
Add EmptyDataRawDescriptor.
polesye 5c88399
Merge pull request #1363 from edx/diana/course-mode-expiration
dianakhuang 7fca5e8
Merge pull request #1360 from edx/valera/carry_over_of_add_option_tra…
brianhw 014089e
Merge pull request #1364 from edx/ned/cherry-pick-pr-1297
brianhw ef22182
LMS: revises CSS reference/pipeline architecture to handle IE9 select…
talbs 56b2205
LMS: corrects indentation issue in hint_manager.html template
talbs e379a77
LMS: removes ie-fixes static:css group from all template references
talbs e0b73b0
LMS: removes error on <html> element syntax for iframed register buttons
talbs bbcb381
LMS: adds in redundant, but needed dashboard visual padding rule
talbs 91c31e1
Implemented bulk email interface for new dashboard
d69748c
disable buttons for large courses on legacy and beta instr dash
adampalay 867d3ba
Implemented bulk email interface for new dashboard
d8a857d
Changed GET to POST and xmodule HTML editor call, section CSS
3f88b87
Added acceptance tests for bulk email (through beta dashboard)
b8aff26
Merged in email confirmation modal
c7d4270
API tests, email tests, working notifications
fd54b06
added self to authors style, changed GET to POST
8a30e9b
Legacy email tests, removed duplicate code, updated comments, fixed CSS
9c94263
Removed email acceptance test
67a8ee1
Revert remnants of disable-button, and how html editor is invoked.
brianhw 8fddcdf
Initial refactoring for bulk_email monitoring.
brianhw ffbb228
Add support for counting and reporting skips in background tasks.
brianhw 2f4774f
Pass status into course_email for tracking retry status.
brianhw 01611c3
Refactor instructor_task tests, and add handling for general errors i…
brianhw 5c29530
Factor out subtask-specific code into subtasks.py.
brianhw 7988b71
Move updates for InstructorTask into BaseInstructorTask abstract class.
brianhw 0fd7518
Update handling of bulk-email retries to update InstructorTask before…
brianhw c133fd9
Use HIGH_PRIORITY_QUEUE for send_course_email.
brianhw 08a0844
Add some handling for SES exceptions.
brianhw 7b7afd4
Incorporate changes in max_retry logic, adding subtask_status as bulk…
brianhw a4c35ac
Use separate retry count for calculating retry delay.
brianhw 04f90fe
Fix subtask code to handle (tests) running in eager mode.
brianhw df0fba9
Add more task-level tests for retries and other errors. Respond to i…
brianhw eaec962
Internationalize task progress.
brianhw 41fcd96
Don't send emails to students who haven't activated.
brianhw c5debc2
Add settings to cap infinite retries.
brianhw 4505fb4
Update InstructorTask before performing a retry.
brianhw e75dd46
Move subtask update logic that was only needed for tests into the tes…
brianhw bc599a0
Update tests with more complete coverage.
brianhw 87a72b7
Rename some constants, and refactor bulk email task flow.
brianhw 22285da
Switch to 0.2.6 version of diff-cover.
brianhw 9861c93
Change calls in beta instructor dash.
brianhw b823906
Check that email subtasks are known to the InstructorTask before exec…
brianhw 86c4a03
admin-console support for enabling email per course
291db0a
Merge pull request #1365 from edx/talbs/lms-cssarch
brianhw 97e01be
Merge pull request #1359 from edx/brian/bulk-email-rc
brianhw 4211749
add UserStanding model
adampalay 1fc993c
add functionality to disable users
adampalay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| """ | ||
| Middleware that checks user standing for the purpose of keeping users with | ||
| disabled accounts from accessing the site. | ||
| """ | ||
| from django.http import HttpResponseForbidden | ||
| from django.utils.translation import ugettext as _ | ||
| from django.conf import settings | ||
| from student.models import UserStanding | ||
|
|
||
| class UserStandingMiddleware(object): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This still has off-kilter indentation. |
||
| """ | ||
| Checks a user's standing on request. Returns a 403 if the user's | ||
| status is 'disabled'. | ||
| """ | ||
| def process_request(self, request): | ||
| user = request.user | ||
| try: | ||
| user_account = UserStanding.objects.get(user=user.id) | ||
| # because user is a unique field in UserStanding, there will either be | ||
| # one or zero user_accounts associated with a UserStanding | ||
| except UserStanding.DoesNotExist: | ||
| pass | ||
| else: | ||
| if user_account.account_status == UserStanding.ACCOUNT_DISABLED: | ||
| msg = _( | ||
| 'Your account has been disabled. If you believe ' | ||
| 'this was done in error, please contact us at ' | ||
| '{link_start}{support_email}{link_end}' | ||
| ).format( | ||
| support_email=settings.DEFAULT_FEEDBACK_EMAIL, | ||
| link_start=u'<a href="mailto:{address}?subject={subject_line}">'.format( | ||
| address=settings.DEFAULT_FEEDBACK_EMAIL, | ||
| subject_line=_('Disabled Account'), | ||
| ), | ||
| link_end=u'</a>' | ||
| ) | ||
| return HttpResponseForbidden(msg) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start files with a module-level docstring.