Commit Graph

40 Commits

Author SHA1 Message Date
M. Zulqarnain
42eacaf8de refactor: pyupgrade in common/util + xblock_django (#26724) 2021-03-09 16:49:51 +05:00
Aarif
a1406cddf2 replaced unittest assertions pytest assertions (#26528) 2021-02-18 18:09:45 +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
Jawayria
f3846144a5 Applied pylint-amnesty to xblock_django 2021-02-02 15:09:08 +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
Dave St.Germain
fbc18460ca Add support for external user ids to the xblock user service. 2020-04-29 08:55:40 -04:00
Dave St.Germain
a5b0f71108 Several optimizations for improving vertical rendering performance. 2020-02-20 11:41:21 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -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
Manjinder Singh
7f3045cf75 BOM-933: Fix type mismatches in various migrations 4 (#22146)
* fix type mismatch in course_goals  migrations

* fix type mismatch in experiments  migrations

* fix type mismatch in xblock_django  migrations

* fix type mismatch in catalog  migrations

* fix type mismatch in static_replace  migrations

* fix type mismatch in bulk_email  migrations

* fix type mismatch in course_overviews migrations
2019-10-24 13:47:51 -04:00
Ayub khan
5c47a3b425 BOM Project
Updated __unicode__ to __str__
2019-09-25 18:31:54 +05:00
Ayub khan
8a95a8e520 BOM-95
assertItemsEqual with six.assertCountEqual
2019-08-21 17:01:40 +05:00
Dave St.Germain
0573b2e4d4 Grade runtime service support for Staff Graded Points 2019-05-16 10:21:46 -04:00
Amit
65f4a63ecf INCR-248: Make compatible with Python 3.x without breaking Python 2.7… (#20529)
* INCR-248: Make compatible with Python 3.x without breaking Python 2.7 support --> common/djangoapps/xblock_django

* INCR-248: Grouped absolute_import and unicode_literals imports

* INCR-248: Grouped absolute_import and unicode_literals imports for migrations
2019-05-13 12:35:39 -04:00
Amit
0bd61d5d9f INCR-133: Run python-modernize on common/djangoapps/xblock_django [migrations, management, tests] (#20520) 2019-05-10 09:47:20 -04:00
Julia Eskew
368f221f0a Initial start on annotations. 2019-02-19 11:24:21 -05:00
cclauss
8fca11b85c Use print() function in both Python 2 and Python 3 2019-01-13 17:16:37 +01:00
Eric Fischer
e18448e27d Silence deprecation warnings
https://docs.djangoproject.com/en/1.11/releases/1.10/#using-user-is-authenticated-and-user-is-anonymous-as-methods
2018-05-02 10:03:50 -04:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Ned Batchelder
8b1978ba6c Fix unused-import errors 2016-08-03 12:44:41 -04:00
cahrens
b8cd96e371 Delete XBlockDisableConfig model.
TNL-4672
2016-07-26 15:49:34 -04:00
Christina Roberts
467bc55d27 Merge pull request #12950 from edx/christina/studio-support-levels
Studio support level of components/xblocks
2016-07-21 17:13:58 -04:00
cahrens
d4cc7b8ffd Support level support for Studio xblock creation.
TNL-4670
2016-07-21 15:44:59 -04:00
Kevin Kim
1ab52f8b0a Merge pull request #12945 from edx/kkim/ora_tz_date
Convert ORA Due Dates
2016-07-21 10:52:07 -04:00
Kevin Kim
94100f5944 Convert ORA due dates to user preferred time zone 2016-07-21 13:57:20 +00:00
cahrens
8980d1ab2d Switch disabling of XBlocks to XBlockConfiguration.
Also allows dynamic updates.
TNL-4668
2016-07-06 11:04:53 -04:00
cahrens
39cf70ecf4 Add new xblock config models.
TNL-4666
2016-06-10 09:52:57 -04:00
Ehtesham
b9c8b3308d [TNL-3962] moving DEPRECATED_ADVANCED_COMPONENT_TYPES to dJango admin 2016-02-08 17:26:49 +05:00
Ned Batchelder
0872732cf0 Fix pylint C7630 (literal used as attribute) violations
There's no need to use a string literal in setattr, delattr, or the
two-argument form of getattr.
2015-11-23 15:32:54 -05:00
Ned Batchelder
f5d0f3ff55 Remove useless pylint suppressions 2015-11-22 07:41:19 -05:00
Usman Khalid
6cb62f2697 Rebase upgrade Django to v1.8.5
Please note that this is a squshed commit and the work of:
Symbolist, macdiesel, nedbat, doctoryes, muzaffaryousaf and muhammad-ammar
2015-11-10 15:00:19 -05:00
Brian Beggs
c71d61e533 Adding django command to create mongodb indexes 2015-08-17 17:05:27 -04:00
Usman Khalid
fe54b085c6 Added ability to disable xblock types in LMS.
TNL-2305
2015-07-03 20:58:40 +05:00
Ned Batchelder
78e9445aa1 Add super() calls to setUp/tearDown that are missing them
Also, I replaced a number of tearDown methods with addCleanup instead.
And also remove some unneeded patch.stopall() calls.
2015-05-14 18:14:21 -04:00
muzaffaryousaf
c461541d35 Refactoring tests.
TNL-1185
2015-01-29 13:33:28 +05:00
muzaffaryousaf
3f4ee28e27 Refactoring the user service test.
TNL-1185
2015-01-29 12:51:30 +05:00
muzaffaryousaf
7b10d14f5d Adding 'user_is_staff' filed to opt_attrs in xblock user.
TNL-1185
2015-01-28 21:37:25 +05:00
muzaffaryousaf
2189ef7c50 Fixing the library tests.
TNL-836
2015-01-28 15:01:40 +05:00
muzaffaryousaf
4d72910060 Adding get_anonymous_user_id in Xblock 'user' service.
TNL-836
2015-01-28 12:47:49 +05:00
Jason Bau
7f1b60b286 Implement user service to return currently-logged-in user
returns XBlockuser with 2 data layers
2015-01-16 11:40:06 -05:00