Commit Graph

4766 Commits

Author SHA1 Message Date
Kyle McCormick
c3d7ab9943 Fix programs cache ADR formatting (#24320) 2020-06-24 11:55:43 -04:00
Nimisha Asthagiri
a219381361 Update 0001-refactor-waffle-flag-default.rst (#24308) 2020-06-23 21:03:06 -04:00
Robert Raposa
f060872878 update waffle flag and docs (#24299)
- update ADR to provide more alternatives for updating
the default value of a flag.
- add a `flag_` prefix to the flag metrics
- add module-level note about flag metrics
- add NewRelic query example and warning
- fix typo in toggle annotation

ARCHBOM-1302
2020-06-23 13:55:06 -04:00
Nick
e8fc653c86 Merge pull request #24285 from edx/ndalfonso/AA-142-calendar-sync-ses
AA-142 calendar sync ses
2020-06-23 13:52:42 -04:00
Nicholas D'Alfonso
5b1d181491 AA-142 calendar sync ses
- set up util function to use Amazon SES for sending calendar
  sync emails.
- remove old sailthru code which we originally implemented for
  this functionality
- include ADR on our decision to use SES instead of Sailthru.
2020-06-23 12:14:03 -04:00
Robert Raposa
a1ed944c72 add temp waffle flag default metric (#24284)
The argument flag_undefined_default is soon to be retired
once ARCHBOM-132 is closed. The following will be used to
help ensure the rollout is complete.

- Add a temporary metric if flag_undefined_default is used.
- Add deprecation warning for flag_undefined_default.
- Add minor fix for waffle flag metric when no request found.

ARCHBOM-132
2020-06-22 13:53:17 -04:00
Robert Raposa
5ea9d313ad add ADR for waffle flag default (#24272)
We are changing how we handle updates to a waffle flag
default, and the ADR explains why and how.

ARCHBOM-1303
2020-06-22 10:12:10 -04:00
Robert Raposa
343a5a8a74 update waffle flag custom metrics (#24270)
The previous version of this code used the Django Setting
ENABLE_WAFFLE_FLAG_METRIC to determine whether to add a single
metric with a dict of details about all flags. Due to
NewRelic's 256 character limit on the metric value, this was
getting truncated.

This new version instead uses the Django Setting
WAFFLE_FLAG_CUSTOM_METRICS, a list of waffle flag names to
instrument.

The name of each custom metric will match the name of the flag.
The value of the custom metric could be False, True, or Both.

The value Both would mean that the flag had both a True and False
value at different times during the transaction. This is most
likely due to having a check_before_waffle_callback, as is the
case with CourseWaffleFlag.

ARCHBOM-132
2020-06-22 10:11:40 -04:00
Ahtisham Shahid
5707bbdc90 updated confirm_email field type (#24205)
* updated confirm_email field type and removed confirm email form v1
2020-06-22 17:10:41 +05:00
Manjinder Singh
566765f919 Removing flaky test (#24262) 2020-06-19 12:13:52 -04:00
David Ormsbee
0b4cf7e06c Merge pull request #23039 from open-craft/samuel/fix-unescaped-selector
SE-2176 Fix elem not selected if id contains special chars
2020-06-19 12:13:20 -04:00
David Ormsbee
bfce2af065 Merge pull request #24058 from open-craft/arbrandes/optimize-blockstore-cache-v2
Optimize blockstore cache
2020-06-19 12:11:59 -04:00
Leonardo Martinez
b4fee68283 Fix the DeprecationWarning for unescape (#23936)
This PR solves the DeprecationWarning mentioned in:
https://build.testeng.edx.org/job/edx-platform-python-pipeline-master/warning_5freport_5fall_2ehtml/

HTMLParser was renamed in html.parser in Python3:
https://docs.python.org/2/library/htmlparser.html#module-HTMLParser

* html_parser.HTMLParser().unescape from six.moves has been deprecated

* instead use html.unescape from Python3

Documentation for unescape in Python3:
https://docs.python.org/3/library/html.html#html.unescape

- html_parser from six.moves has been deprecated

- instead use html.parser from Python3

- Order imports using isort

- Delete unused import crum
2020-06-19 09:27:45 -04:00
stvn
994b2b002f Add explicit masquerade support to courseware API 2020-06-18 14:54:49 -07:00
stvn
a69855e9ad Merge PR #24245 cleanup/log.warn
* Commits:
  Replace references to 'log.warn' with 'log.warning'
2020-06-18 14:50:37 -07:00
Daniel Francis
82c0ca0da8 Fixing implicit parser name for Beautiful Soup (lms, openedx) (#24100)
Fixing 56 GuessedAtParserWarnings, in commit edx#24098

Background: BeautifulSoup automatically picks the fastest parser available. By default, it picks the "lxml" parser.

Per the [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/#installing-a-parser) documentation:

> Beautiful Soup supports the HTML parser included in Python’s standard library, but it also supports a number of third-party Python parsers. One is the lxml parser. Depending on your setup, you might install lxml with one of these commands.
> Another alternative is the pure-Python html5lib parser, which parses HTML the way a web browser does. 

Context: We changed two statements, one in lms and another in openedx. Both statements fire up BeautifulSoup. Now we explicitly ask for "lxml," following the recommendation on BeautifulSoup's documentation:

> If you can, I recommend you install and use lxml for speed. If you’re using a very old version of Python – earlier than 2.7.3 or 3.2.2 – it’s essential that you install lxml or html5lib. Python’s built-in HTML parser is just not very good in those old versions.

Before:
`soup = BeautifulSoup(content)`

After:
`soup = BeautifulSoup(markup=content, features="lxml")`

The warnings are gone, tests are passing in local.
2020-06-18 15:41:07 -04:00
stvn
0ae91c0921 Replace references to 'log.warn' with 'log.warning'
to remove some `DeprecationWarning`s from the logs
as the former method as been deprecated since Python 3.3 [1][2].

- [1] https://github.com/python/cpython/blob/3.3/Lib/logging/__init__.py#L1252-L1253
- [2] https://stackoverflow.com/a/15655674
2020-06-18 12:08:15 -07:00
Robert Raposa
a1572dafce add waffle_flag custom metric (#24244)
If setting ENABLE_WAFFLE_FLAG_METRIC is True, a custom
metric will be added with the values of all WaffleFlag
and CourseWaffleFlags seen during the transaction.

Metric flag values could be False, True, or Both.
The value Both would mean that the flag had both
a True and False value at different times through
the transaction. This is most likely due to having a
check_before_waffle_callback, as is the case with
CourseWaffleFlag.

Example metric value:

    "{'another.course.flag': 'False', 'some.flag': 'False', 'some.course.flag': 'Both'}"

Warning: NewRelic does not recommend large custom
metric values due to the potential performance
impact on the agent, so you may just want to
enable when researching usage of a particular flag.
Metric values longer than 255 are truncated.

TODO: A how_to can be added later if we find this
useful, including helpful querying tips.

ARCHBOM-132
2020-06-18 12:21:57 -04:00
Michael Terry
d325943fe5 Merge pull request #24169 from edx/mikix/celebration
AA-137: Support courseware celebrations
2020-06-18 10:49:36 -04:00
atesker
12aba3bd94 PR comments 2020-06-18 10:31:24 -04:00
atesker
8bf47afdae Initial ADR draft - comments and move 2020-06-18 10:31:24 -04:00
atesker
992ca3174e Initial ADR draft 2020-06-18 10:31:24 -04:00
Adam Butterworth
c37f73c40e Merge pull request #24158 from eduNEXT/lmm/course_sock_standalone
[BD-10] Remove unused course sock URL.
2020-06-18 09:16:26 -04:00
Adam Butterworth
4ebe6a8458 Merge pull request #24111 from eduNEXT/ama/DEPR-79
[BD-10] [DEPR-79] Remove pattern library of mobile/course-dates-fragment.html
2020-06-18 09:15:43 -04:00
Adam Butterworth
98dd03a638 Merge pull request #24077 from eduNEXT/ama/DEPR-78/DEPR-82
[BD-10] [DEPR-78][DEPR-82] Remove pattern library of latest-update-fragment.html and welcome-message-fragment.html
2020-06-18 09:15:20 -04:00
Adam Butterworth
0768acbf40 Remove pattern library of course_experience/course-outline-fragment.html (#24044) 2020-06-18 09:14:38 -04:00
Ali Akbar
edd9b02d52 Merge pull request #180 from edx/sustaining-xsslint-security-fixes
Sustaining xsslint security fixes
2020-06-18 11:32:39 +05:00
morenol
41543edd93 Remove course_experience.use_bootstrap waffle flag (#24028)
[BD-10] [DEPR-83]
2020-06-17 13:26:51 -04:00
Ahtisham Shahid
1743e0e590 Merge pull request #24228 from edx/ahtisham/PROD-1679
Removed confirm email after SSO
2020-06-17 12:25:26 +05:00
Michael Terry
450072582e AA-137: Support courseware celebrations
- Add a new CourseEnrollmentCelebration model, which ties a
  course enrollment to some booleans about progress celebrations
- Add serialization of the new model to the existing courseware_api
  app's existing course info view
- Add new API in courseware_api to update a celebration model
2020-06-16 15:19:21 -04:00
Ahtisham Shahid
340e00988f Removed confirm email after SSO 2020-06-16 14:06:52 +05:00
SaadYousaf
52cfe647b3 syncing certificates on course update on credential side. 2020-06-16 11:58:49 +05:00
Samuel Walladge
43f0cd72af Merge remote-tracking branch 'origin/master' into samuel/fix-unescaped-selector 2020-06-16 09:52:38 +09:30
Nick
badf3281b3 Merge pull request #24122 from edx/ndalfonso/AA-133-mfe-dates-banner
AA-133 mfe dates banner
2020-06-15 15:08:02 -04:00
Nicholas D'Alfonso
9a83d0781b AA-133 mfe dates banner
- add serializer mixin to expose date banner info
- add endpoint to reset deadlines for a sepcific course
2020-06-15 14:22:23 -04:00
Michael Terry
557079042f Guard highlights against null module
Sometimes a course module will not exist and was causing exceptions
in our weekly highlights mail code. This will hopefully guard against
that a bit better.
2020-06-12 14:57:09 -04:00
Calen Pennington
06e5e2db51 Merge pull request #24144 from cpennington/hide-dates-banner-archived
Hide dates banner archived
2020-06-11 14:03:09 -04:00
Calen Pennington
86e2677f26 Use a standard function to find out if a course has ended 2020-06-11 11:40:56 -04:00
Calen Pennington
1cf46e76d0 Don't compare None to a date when a course doesn't have an end date 2020-06-11 11:40:56 -04:00
Calen Pennington
333c9ccddf Simplify how the course-outline template context is constructed to bring it into parity with other template contexts 2020-06-11 11:40:56 -04:00
Calen Pennington
2b2a6cca23 Never show the dates banner on archived courses 2020-06-11 11:13:55 -04:00
Stu Young
b370745b9b management command to retire a single user (#24188) 2020-06-10 18:07:25 -04:00
Calen Pennington
c6695e0b6f Only actually reset user schedule if they have missed deadlines and not missed any gated content deadlines 2020-06-10 15:18:53 -04:00
Calen Pennington
15df17034a Only prompt the user to upgrade if they have missed the deadline of gated graded content 2020-06-10 15:18:53 -04:00
Daniel Francis
4dc3251af5 render_to_response deprecated in Django 3 (#24141)
Fixing RemovedInDjango30Warnings

**Background:** The `django.shortcuts` method `render_to_response` became deprecated in [Django 1.3](https://docs.djangoproject.com/en/3.0/releases/1.3/), when  `render` was introduced.

Per the documentation:

> render() is the same as a call to render_to_response() with a context_instance argument that forces the use of a RequestContext.

Both return an `HttpResponse` object.

**Context:** We changed two statements: An import line and the call to the method, adding explicit parameter names to improve readability.

**Before:**
```
from django.shortcuts import get_object_or_404, render_to_response
...
return render_to_response("teams/teams.html", context)


```

**After**
```
from django.shortcuts import get_object_or_404, render
...
return render(
            request=request,
            template_name="teams/teams.html",
            context=context
        )

```
2020-06-10 14:25:04 -04:00
Luis Moreno
070eb3807d Remove unused URL. 2020-06-10 13:59:21 -04:00
SaadYousaf
2339fa4f6d PROD-1570 2020-06-10 21:07:10 +05:00
Ali-D-Akbar
0ecbe873d9 PROD-1574 2020-06-10 21:07:10 +05:00
Ali-D-Akbar
c9e24e9a1d PROD-1572 2020-06-10 15:05:28 +05:00
Ali-D-Akbar
c2832dfb61 PROD-1571 2020-06-10 15:04:45 +05:00