Commit Graph

102 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
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
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
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
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
Jeremy Bowman
b351e58c25 Fix bulk email i18n tests under Python 3 BOM-927 (#22052) 2019-10-17 10:40:47 -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
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05: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
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
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
Eric Fischer
19c580e52f No unicode in "from" value on Bulk Emails
Until https://github.com/django-ses/django-ses/issues/137 is resolved, we need
to proactively search for and prevent unicode values in from_addr.

EDUCATOR-1773
2017-11-21 11:32:31 -05:00
Andy Armstrong
79acb5c5be Reorder LMS imports using isort 2017-06-11 21:48:06 -04:00
Adam Palay
c478e796d2 fix for issue where emails to students in one track are sent to users in other tracks, too (EDUCATOR-217) 2017-05-15 08:48:11 -04:00
Omar Al-Ithawi
3739cc4549 Make the course lang override platform lang 2017-04-05 16:48:53 +03:00
Omar Al-Ithawi
d29453204d Simplified the test 2017-04-05 16:48:53 +03:00
Omar Al-Ithawi
0a9a39e4b1 Translatable bulk_email from Address based on platform`s default language 2017-04-05 16:48:53 +03:00
Eric Fischer
4b794372cd Add registration tracks as valid bulk_email targets
Hackathon XV project
2017-01-12 15:05:49 -05:00
Sanford Student
54d34e834d update all references to instructor module 2016-10-12 11:35:02 -04:00
Matjaz Gregoric
344c72b3e2 Use non-ascii PLATFORM_NAME in tests.
It should help catch unicode encoding problems earlier.

This also updates python-saml dependency to a version that includes a
patch for unicode strings.
2016-09-23 15:38:23 +02:00
Cliff Dyer
05bfd80f05 Merge pull request #12934 from open-craft/jill/fix-bulk-email-url-scheme
Use appropriate URL scheme for bulk emails
2016-08-09 15:53:14 -04:00
Calen Pennington
bc20a37c2b Simplify how shards are selected in CI 2016-08-03 16:23:02 -04:00
Ned Batchelder
8b1978ba6c Fix unused-import errors 2016-08-03 12:44:41 -04:00
Jillian Vogel
cf8e0e4464 Uses new settings.LMS_ROOT_URL as email base url
instead of constructing it from settings.HTTPS and settings.SITE_NAME
2016-08-02 04:05:23 +09:30
Jillian Vogel
f28cca00f3 Uses settings.HTTPS to determine appropriate URL scheme for bulk emails 2016-08-02 03:17:56 +09:30
Jillian Vogel
0390294d3c Uses http or https appropriately in bulk email urls
and adds system tests for affected methods.
2016-08-02 03:17:56 +09:30
Eric Fischer
faa7f544d2 Bulk Email Cohorts (#12602)
Adds cohorts as valid bulk email targets.
2016-06-06 16:32:59 -04:00
Eric Fischer
a9a3fabfe8 Bulk Email Multiselect (#12301)
TNL-4356

Allows multiple bulk email targets to be specified at once.

-The previous "All" option has been split into "Staff" and "Learners"
-The backend changes made here lay the groundwork for cohort emailing
-The data migration, 0005, is somewhat large and requires deploy attention
-Tests have been updated
-Numerous safe-commit-linter fixes are included
2016-05-26 14:22:04 -04:00
Adam
cf8e37b381 Merge pull request #12455 from edx/adam/fix-email-from-addr-length
refine from_addr length limits (TNL-4264)
2016-05-17 08:30:15 -04:00
Eric Fischer
0cf3e39c31 Replace bulk email settings with admin config models
Moves ENABLE_INSTRUCTOR_EMAIL and REQUIRE_COURSE_EMAIL_AUTH from settings files
to admin-accessible configuration models. This allows for the bulk email settings
to be modified without a new AMI deploy. See TNL-4504.

Also updates tests:
    -python tests mock out the new configurations in place of the old settings
    -lettuce test has been moved to bokchoy
        (note that there was some loss of coverage here - the lettuce tests had
        been doing some voodoo to allow for cross-process inspection of emails
        messages being "sent" by the server, from the client! In discussion with
        testeng, this seems outside the realm of a visual acceptance test. So,
        the bokchoy test simply confirm the successful queueing of the message,
        and leaves the validation of sending messages to the relevant unit tests.)
    -bok choy fixture has been added, to replace the settings in acceptance.py
    -lettuce and bok choy databases have been updated to reflect the backend changes

The new default is to have bulk_email disabled, we'll need to call this out in the
next OpenEdx release to ensure administrators enable this feature if needed.
2016-05-16 11:09:39 -04:00
Adam Palay
c9b0e12d39 use markupspace for escaping 2016-05-13 11:15:00 -04:00
Adam Palay
91ae60f5e9 refine from_addr length limits (TNL-4264) 2016-05-12 15:12:41 -04:00
Adam
bb5874d5a1 truncate email from addresses if >320 chars when encoded (TNL-4264) (#12171)
* truncate email from addresses if >320 chars when encoded (TNL-4264)

* use exact lengths
2016-04-20 08:43:26 -04:00
Adam Palay
6e43d97fe7 make sure email from addresses don't exceed 320 characters (TNL-4264)
clean up and fix quality violations

since get_course can never return None, we can remove these lines
2016-03-31 14:23:08 -04:00
Ned Batchelder
43ac38aa87 Add autospec to all mocks 2015-12-09 09:44:22 -05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00