Commit Graph

418 Commits

Author SHA1 Message Date
Usama Sadiq
aa618c460c refactor: remove unused-imports (#27083) 2021-03-19 22:42:14 +05:00
Jawayria
10d4c5259d Merge pull request #26581 from edx/jawayria/bom-2352-8
BOM-2352: Removed unused imports from lms/djangoapps/{lti_provider, m…
2021-03-17 12:56:53 +05:00
Kyle McCormick
9aefd6f986 style: django-not-configured is not a sensible lint-amnesty value (#26862)
django-not-configured is an error raised by pylint (with
the pylint-django plugin) when it's not correctly configured.

We should not be applying lint amnesty for such a violation.
2021-03-05 08:11:58 -05:00
Usman Khalid
dd96a2aa72 Convert Course, Section and Sequence XModules to XBlocks. (#25965) 2021-03-02 10:29:33 -05:00
Jawayria
10e9fc5b13 BOM-2352: Removed unused imports from lms/djangoapps/{lti_provider, mobile_api, teams} 2021-02-23 17:23:47 +05:00
M. Zulqarnain
0fdb3fce9a pyupgrade on survey, teams and tests apps (#26647) 2021-02-23 15:50:22 +05:00
Aarif
c828beb5d1 replaced unittest assertions pytest assertions (#26549) 2021-02-23 10:24:42 +05:00
usamasadiq
96f0915b0f Fixed new pylint warnings.
use generator in any/all()
disable not-callable warnings
disable no-member warnings
Suppressed smaller pylint warnings
Pin edx-proctoring==3.5.0
2021-02-22 16:36:53 +05:00
Tim McCormack
80a4437f33 fix: Always save generated anonymous user ID in DB; ignore save=False (#26399)
This deprecates `save=False` for several functions and removes all known
usages of the parameter but does not actually remove the parameter.
Instead, it will emit a deprecation warning if the parameter is used.
We can remove the parameter as soon as we feel sure nothing is using it.

Now that we have refactored `anonymous_id_for_user` to always prefer
retrieving an existing ID from the database -- and observed that only a
small fraction of calls pass save=False -- we can stop respecting
save=False. This opens the door for future improvements, such as generating
random IDs or switching to the external user ID system.

Metrics: I observe that 1 in 16 requests for new, non-request-cached
anon user IDs are made with save=False. But 71% of all calls are served
from the request cache, and 99.7% of the misses are served from the DB.
save=False only appear to come from intermittent spikes as reports are
generated and are low in absolute number.

Also document usage/risk/rotation of secret in anonymous user ID
generation as indicated by `docs/decisions/0008-secret-key-usage.rst`
ADR on `SECRET_KEY` usage.

ref: ARCHBOM-1683
2021-02-08 19:16:05 +00:00
Ali-D-Akbar
c7a467b04d PROD-1999 2021-02-04 10:20:25 +05:00
M. Zulqarnain
feaf5011c8 BOM-2287 : Pylint amnesty in teams,tests,survey and verify_student (#26305)
* lint amnesty in teams,tests,survey and verify_student
2021-02-03 18:15:03 +05:00
Ali-D-Akbar
3b03e9c2f7 PROD-2117 2021-01-20 00:42:35 +05:00
Nathan Sprenkle
0e194bf517 Add team protection tests for CSV team management (#26019) 2021-01-11 10:42:50 -05:00
Ali-D-Akbar
8f4ac5c112 disable xsslint 2021-01-07 16:40:10 +05:00
Régis Behmo
a16cd71046 Start waffle namespace deprecation
By explicitly importing the legacy namespace classes, we make it clear
that we are using soon-to-be-deprecated classes. We will then be able to
start removing the legacy classes, one module at a time.
2020-12-03 16:06:14 +01:00
Diana Huang
afeea75d9e Add changes to support ES7 and edx-search 2.0 back into the tree. 2020-11-17 13:23:13 -05:00
Diana Huang
8d652e6a4b Revert "Merge pull request #25515 from edx/diana/edx-search"
This reverts commit 9714d7412f, reversing
changes made to 5bc7c3996b.
2020-11-13 13:16:16 -05:00
Diana Huang
fd730a7af3 Set maximum search size to the ES default max. 2020-11-13 11:13:02 -05:00
Diana Huang
33d0a18d56 Update edx-platform to use Elasticsearch 7.
This reverts commit b73f755487.
2020-11-13 11:13:01 -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
Régis Behmo
daef264ebb Use SettingDictToggle to document ENABLE_ORA_TEAM_SUBMISSIONS 2020-10-29 11:11:02 +01:00
Feanil Patel
b73f755487 Revert "Feanil/edx search update (#25406)" (#25412)
This reverts commit 581b20056d.
2020-10-22 15:53:57 -04:00
Feanil Patel
581b20056d Feanil/edx search update (#25406)
OeX_ES-44:  Update edx-search elasticsearch.


* removes redundant doc_types from the lms/cms, replaces courseware
index with doc_types to two indices
* code polishing

* Use a new config variable for ES7 deployment. (#2226)

Co-authored-by: Golub-Sergey <1.golub.sergey.1@gmail.com>
Co-authored-by: Diana Huang <diana.k.huang@gmail.com>
2020-10-22 14:18:19 -04:00
Régis Behmo
307457a255 Simplify hack to obtain waffle module names
Instead of going up the stacktrace to find the module names of waffle
flags and switches, we manually pass the module __name__ whenever the
flag is created. This is similar to `logging.getLogger(__name__)`
standard behaviour.

As the waffle classes are used outside of edx-platform, we make the new
module_name argument an optional keyword argument. This will change once
we pull waffle_utils outside of edx-platform.

Note that the module name is normally only required to view the list of
existing waffle flags and switches. The module name should not be
necessary to verify if a flag is enabled. Thus, maybe it would make
sense to create a `add` class methor similar to:

    class WaffleFlag:
        @classmethod
        def add(cls, namespace, flag, module):
            instance = cls(namespace, flag)
            cls._class_instances.add((instance, module))
2020-09-14 09:30:24 +02:00
Jansen Kantor
54f6cbdec9 EDUCATOR-5312: Learners unable to create new Teams if 0 teams currently exist (#24948)
* reproduce

* Prevent 404 for empty non-private teamset

* add another teamset to teams view tests

* don't return 404 for staff querying empty private teamset
2020-09-10 12:34:57 -04:00
Jansen Kantor
f0ae71ab76 add get_team_by_team_id to teams service (#24783) 2020-08-17 16:04:34 -04:00
Uzair Rasheed
314fae8928 Merge pull request #190 from edx/security-fix/fix-xss-date
Fix xss in date
2020-07-30 10:59:44 +05:00
Uzair Rasheed
32fae72852 Merge pull request #192 from edx/security-fix/fix-xss-edit-member
Fix xss in edit member template
2020-07-30 10:59:21 +05:00
Ben Warzeski
beace438a4 update search description on new search string (#24619)
* update search description on new search string

* disable xss-lint rule for jquery.html
2020-07-28 09:21:59 -04:00
uzairr
6b8f903188 Fix xss in edit member template 2020-07-23 22:49:08 +05:00
uzairr
a006eef364 Fix xss in date 2020-07-22 03:01:21 +05:00
Nathan Sprenkle
620bbd7649 Hide search boxes in private team-sets for non-privileged users (#24444) 2020-07-15 12:30:06 -04:00
Justin Lapierre
1c57bf1be5 Merge pull request #24348 from edx/EDUCATOR-5080
Educator 5080 - Refactor, rename and update docscript to reflect current teamset driven functionality
2020-07-14 13:57:38 -04:00
Justin Lapierre
6efa2c8f94 EDUCATOR-5080 - Removed repeat argument from test method 2020-07-10 08:58:39 -04:00
Mat Carter
5a90bf7f40 EDUCATOR-5088 - updated test to ensure record is stored. 2020-07-09 14:24:19 -04:00
Mat Carter
b386f0a25e ensure anonymous_id is persisted for each team member in a team 2020-07-09 14:24:19 -04:00
Justin Lapierre
d5a01142a8 EDUCATOR-5080 - All tests passing, all code review comments addressed 2020-07-08 08:27:04 -04:00
Justin Lapierre
6797c9c0fa EDUCATOR-5080 - Fixing tests 2020-07-08 07:52:29 -04:00
Justin Lapierre
c371af4778 Merge branch 'master' of github.com:edx/edx-platform into EDUCATOR-5080 2020-07-07 08:36:10 -04:00
Ben Warzeski
d99890fb1a Team card teamset name (#24360)
* show teamset as pennant in team cards within my_teams view

* update verifyCards spec helper to be able to check teamset label

* update tests for team_card teamset label.

Co-authored-by: Ben Warzeski <benwarzeski@edX-C02CD0HCLVDM.cable.rcn.com>
2020-07-01 15:37:45 -04:00
Justin Lapierre
3c5edb9524 EDUCATOR-5080 - Switched back to using topid_id in the method due to a cascade of test failures. Added ticket to cover the refactor at a future time 2020-07-01 11:02:37 -04:00
Justin Lapierre
70f5c98fb7 EDUCATOR-5080 - Updated views test case to account for teamset_id as opposed to topic_id 2020-07-01 09:40:46 -04:00
Justin Lapierre
7d47bc39dc EDUCATOR-5080 - Fixed test according to linting rules 2020-07-01 09:28:43 -04:00
Justin Lapierre
8735f8aa0d EDUCATOR-5080 - Fixed linting issue in the tests 2020-07-01 09:07:44 -04:00
Justin Lapierre
ae848f9830 EDUCATOR-5080 - Responding to code review comments, removed deprecated test, updated docstrings, fixed linting issue 2020-07-01 08:39:43 -04:00
Justin Lapierre
6980a996c1 Merge branch 'master' of github.com:edx/edx-platform into EDUCATOR-5080 2020-07-01 06:26:56 -04:00
atesker
d70303a893 EDUCATOR-5127 - update message 2020-06-30 11:55:21 -04:00
Justin Lapierre
309547d464 EDUCATOR-5080 - Updated doctring to represent the current behavior 2020-06-29 13:04:48 -04:00
Justin Lapierre
638a740625 EDUCATOR-5080 - Removed unused course logic, renamed method to refer to teamsets, updated docstrings, api and tests 2020-06-29 09:35:18 -04:00
Aarif
9e34cb3df9 Removed deprecated future imports (#24295) 2020-06-28 23:40:03 +05:00