Commit Graph

199 Commits

Author SHA1 Message Date
Asad Iqbal
82c90b40b0 Added setting to manage from_email address (#24951)
Co-authored-by: asadiqbal08 <asad.iqbal@arbisoft.com>
2021-04-02 12:08:51 -04:00
Michael Terry
570a869bd3 feat: update to edx-ace 1.0.0
The new version switches how you specify recipients, to use
lms_user_id instead of usernames.

AA-489
2021-03-12 10:25:54 -05:00
Usama Sadiq
7f6cabbf98 Ran pyupgrade on lms/djangoapps (#26519)
* refactor: ran pyupgrade on lms/djangoapps/bulk_enroll
Co-authored-by: M. Zulqarnain <muhammad.zulqarnain@arbisoft.com>
2021-03-01 17:13:18 +05:00
Aarif
f35ff6a1eb replaced unittest assertions pytest assertions (#26540) 2021-02-18 19:13:47 +05:00
M. Zulqarnain
6f2d54d53b BOM-2268 : Add Pylint amnesty for Bulk Email (#26208)
* Add Amnest for Bulk Email
2021-02-03 18:15:37 +05:00
Kyle McCormick
54d5f7f394 Course Blocks API: Fix handling of incorrectly-cased course keys (#25911)
Commit 7f59688 attempted to solve this using
`CourseOverview.course_exists`, but that check is case-
insensitive. This commit instead does a small refactor
to `lms.djangoapps.courseware.get_course` so that we can
handle a failed course lookup without broadly catching
a `ValueError`.
2020-12-18 11:26:29 -05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Kyle McCormick
d1a775d3cd Use full names for lms.djangoapps imports (#25401)
* Use full LMS imports paths in LMS settings and urls modules
* Use full LMS import paths in Studio settings and urls modules
* Import from lms.djangoapps.badges instead of badges
* Import from lms.djangoapps.branding instead of branding
* Import from lms.djangoapps.bulk_email instead of bulk_email
* Import from lms.djangoapps.bulk_enroll instead of bulk_enroll
* Import from lms.djangoapps.ccx instead of ccx
* Import from lms.djangoapps.course_api instead of course_api
* Import from lms.djangoapps.course_blocks instead of course_blocks
* Import from lms.djangoapps.course_wiki instead of course_wiki
* Import from lms.djangoapps.courseware instead of courseware
* Import from lms.djangoapps.dashboard instead of dashboard
* Import from lms.djangoapps.discussion import discussion
* Import from lms.djangoapps.email_marketing instead of email_marketing
* Import from lms.djangoapps.experiments instead of experiments
* Import from lms.djangoapps.gating instead of gating
* Import from lms.djangoapps.grades instead of grades
* Import from lms.djangoapps.instructor_analytics instead of instructor_analytics
* Import form lms.djangoapps.lms_xblock instead of lms_xblock
* Import from lms.djangoapps.lti_provider instead of lti_provider
* Import from lms.djangoapps.mobile_api instead of mobile_api
* Import from lms.djangoapps.rss_proxy instead of rss_proxy
* Import from lms.djangoapps.static_template_view instead of static_template_view
* Import from lms.djangoapps.survey instead of survey
* Import from lms.djangoapps.verify_student instead of verify_student
* Stop suppressing EdxPlatformDeprecatedImportWarnings
2020-11-04 08:48:33 -05:00
Calen Pennington
2714da86a4 Always import task packages by absolute paths
This follows the recommendation in the Celery documentation so as to
not confuse automatic task name generation.

Docs: https://docs.celeryproject.org/en/stable/userguide/tasks.html#automatic-naming-and-relative-imports
2020-10-08 14:10:17 -04:00
Calen Pennington
4a120a9e26 Fix failures caused by removing lms/djangoapps from sys.path 2020-09-23 10:05:37 -04:00
adeelehsan
12708a093d Unsubscribe link added in bulk emails 2020-01-15 16:56:35 +05:00
Feanil Patel
046feb0cf0 Merge pull request #22649 from edx/feanil/fix_pep8
Fix all E303 pep8 errors.
2019-12-30 13:32:26 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -05:00
Feanil Patel
2df8b8226b Merge pull request #22643 from edx/feanil/2to3_asserts
Run `2to3 -f asserts . -w` on edx-platform.
2019-12-30 12:13:42 -05:00
Feanil Patel
39d3a7ca17 Fix pep8 issues caused by the fixer. 2019-12-30 11:42:04 -05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Feanil Patel
70294b0ad2 Run 2to3 -f asserts . -w on edx-platform.
https://docs.python.org/3.5/library/2to3.html#2to3fixer-asserts
2019-12-30 10:22:19 -05:00
Taranjeet Singh
00653433a5 Adds optional "unsubscribe" link and api support to let users opt out of email updates.
Scheduled emails show "unsubscribe" link if waffle switch
`schedules.course_update_show_unsubscribe` is enabled, and
settings.ACE_ENABLED_POLICIES respects `bulk_email_optout`.

API endpoint allows GET/POST requests, which:

* GET asks for confirmation of opt-out
* POST accepts "unsubscribe" or "cancel", where "unsubscribe" creates the
  Optout entry, and "cancel" does nothing.

Fixes flaky tests:

* The resolvers handle users in "bins", which are groups that depend on the user ID.
* The test user ID varies depending on the test order.
* This change ensures that the bin requested matches the user for the test.
2019-12-09 22:49:57 +10:30
Jeremy Bowman
b351e58c25 Fix bulk email i18n tests under Python 3 BOM-927 (#22052) 2019-10-17 10:40:47 -04:00
Nimisha Asthagiri
beb95eb69c Python 3: assertIn -> assertContains consistency 2019-09-30 08:51:01 -04:00
Nimisha Asthagiri
a6b219a9e9 Python-3: assertIn(..response.content) -> assertContains 2019-09-30 08:50:38 -04:00
Ned Batchelder
efba6e45e8 Finally import courseware properly everywhere to get rid of a warning 2019-09-26 09:40:15 -04:00
Ayub khan
5c47a3b425 BOM Project
Updated __unicode__ to __str__
2019-09-25 18:31:54 +05:00
Ayub
85be57b64a Merge pull request #21397 from edx/BOM-95
BOM-95
2019-08-22 12:41:08 +05:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
Feanil Patel
73a146fbbe Revert "assertItemsEqual() moved to assertCountEqual()"
This reverts commit 3d2617983b.

The change was not quite right because the method six provides needs to
have `self` be passed in as well.  See the docs here:
https://six.readthedocs.io/#unittest-assertions

Reverting for now and we can fix it in smaller chunks later.
2019-08-20 15:31:20 -04:00
Dave St.Germain
3d2617983b assertItemsEqual() moved to assertCountEqual() 2019-08-19 17:00:17 -04:00
Nimisha Asthagiri
d564af8301 Fix for decode errors in bulk_email.tests.test_course_optout.py 2019-08-19 14:26:48 -04:00
David Ormsbee
9a1385585f Convert response bytes to str before JSON parsing. (#21375)
Convert response bytes to str before JSON parsing.
2019-08-19 11:01:55 -04:00
Nimisha Asthagiri
6e214a85b0 Move common/djangoapps/enrollment to openedx/core/djangoapps/enrollments 2019-05-28 11:20:53 -04:00
Michael Roytman
5da94023e6 Merge pull request #20620 from edx/mroytman/bulk-email-python-api
introduce Python API for BulkEmail Djangoapp
2019-05-21 18:38:24 -04:00
Stu Young
da616921f0 INCR-257 Run python-modernize on lms/djangoapps/bulk_email/migrations and lms/djangoapps/bulk_email/tests (#20563)
* run python modernize

* run isort

* Fix quality
2019-05-21 11:34:42 -04:00
Michael Roytman
b33b8e8897 introduce Python API for BulkEmail Djangoapp 2019-05-21 09:22:08 -04:00
Michael Youngstrom
3221c2b91f Remove lms pytest shards 2019-02-12 11:03:46 -05:00
Awais Jibran
717712391f Fixing conflicts 2019-02-12 17:50:58 +05:00
Taranjeet Singh
3eb9058dd2 Adds optional "unsubscribe" link and api support to let users opt out of email updates.
Scheduled emails show "unsubscribe" link if waffle switch `schedules.course_update_show_unsubscribe` is enabled, and
settings.ACE_ENABLED_POLICIES respects `bulk_email_optout`.

API endpoint allows GET/POST requests, which:

* GET asks for confirmation of opt-out
* POST accepts "unsubscribe" or "cancel", where "unsubscribe" creates the
  Optout entry, and "cancel" does nothing.
2019-02-07 11:47:10 +10:30
Matthew Piatetsky
6e81c84d8b fix unicode strings in lms/ part 1 2019-02-05 15:15:02 -05:00
cclauss
8fca11b85c Use print() function in both Python 2 and Python 3 2019-01-13 17:16:37 +01:00
Awais Jibran
ac3c274d57 Skip sending email if an email address contains non-ascii char. 2018-09-27 22:45:15 +05:00
Jeremy Bowman
1a5bf35357 TE-2689 Remove useless pylint suppressions part 2 2018-08-14 17:39:02 -04:00
Jeremy Bowman
ca3316962d TE-2524 Stop using nose.plugins - LMS 1 2018-07-31 13:03:18 -04:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
Stuart Young
1fd2167144 rebalance python unittests onto new shards 2018-05-03 11:16:05 -04:00
bmedx
65147386c0 PLAT-2028 - Create mailing list retirement API endpoint
- Removes "email-optin" UserOrgTags for the user
- Creates and uses a new "UserRetireMailingsSignal" signal
- Creates and uses a new "CanRetireUser" permission
- Creates and uses a new setting "RETIREMENT_SERVICE_WORKER_USERNAME"
- Creates a signal handler to globally opt-out the user from Sailthru
2018-04-05 15:52:26 -04:00
Awais Jibran
5eb176039c Do not show Currencies: usd in bulk email task history Sent To:
This is a bad course team experience that when they send email to Audit track learners, `send to` includes currency (usd) which is set default. This PR fixes the bug and will not include currency with `audit` or `honor` enrollment tracks.
EDUCATOR-2489
2018-03-09 21:06:50 +05:00
Jeremy Bowman
9682e00f4c PLAT-1943 Fix more naive datetime warnings 2018-02-05 17:58:35 -05:00
John Eskew
27edca3c5e Replace all clean_course_id form methods with common method. 2018-01-25 11:38:46 -05:00
Jeremy Bowman
669aa13ad6 PLAT-1873 to_deprecated_string() cleanup part 2 2018-01-08 17:26:55 -05:00
Jeremy Bowman
d3d6272d8f PLAT-1873 to_deprecated_string() cleanup part 1 2018-01-08 13:51:42 -05:00
Eric Fischer
3312939703 Revert "Merge pull request #16635 from edx/efischer/EDUCATOR-1773"
This reverts commit 3e9e97e6d8, reversing
changes made to 0d931107aa.
2017-12-04 11:55:09 -05:00