Commit Graph

65 Commits

Author SHA1 Message Date
Jawayria
3743aa7dc8 BOM-2352: Removed unused-imports from lms/djangoapps/verify_student 2021-04-02 17:15:14 +05: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
M. Zulqarnain
ba86198519 pyupgrade on verify_students app (#26648) 2021-03-02 16:45:01 +05:00
Aarif
c828beb5d1 replaced unittest assertions pytest assertions (#26549) 2021-02-23 10:24:42 +05:00
Bianca Severino
2e72791491 Create command to update expiration_date for old SoftwareSecurePhotoVerification entries (#26471) 2021-02-10 16:55:51 -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
Kyle McCormick
8b1162e6ae Clean up deprecated edx-platform imports of edxmako & util (#25684) 2020-12-15 09:04:03 -05:00
0x29a
8961db4f10 Fix imports, remove unused import 2020-11-19 14:37:09 +01:00
Bianca Severino
56d7ff8017 Set expiration_date field in IDVerificationAttempt model 2020-11-10 15:29:47 -05:00
Bianca Severino
82e8592fbe Revert "Set expiration_date field in IDVerificationAttempt model" 2020-11-10 14:24:07 -05:00
Bianca Severino
3342524699 Update IDVerificationAttempt to use expiration_date field 2020-11-10 11:15:04 -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
Bianca Severino
4d19d9687c Change URLs in IDV related emails to the new experience 2020-08-12 09:22:42 -04:00
Bianca Severino
041becc846 Implement waffle flag for IDV redirect
Created helper function to render url dynamically

Modify helper function to include reverify links

Fix code based on failing tests

Fixed query string in redirect URL
2020-07-13 16:43:59 -04:00
Asad
206977d571 Fixed email sent on valid sso verification 2020-07-09 13:37:35 +05:00
Awais Jibran
804fac9358 Adds retry logic for software secure 2020-04-13 14:14:11 +05:00
Waheed Ahmed
3dc3e10819 Revert "Adds retry logic for software secure." 2020-04-07 20:40:06 +05:00
Awais Jibran
de3410c733 Move attempt.refresh_from_database call to the tests. 2020-04-06 17:04:58 +05:00
Awais Jibran
4ead215665 Adds retry logic for ss.
1. Created a new celery queue with key `SOFTWARE_SECURE_VERIFICATION_ROUTING_KEY`.
2. Added a celery task with retry logic.
3. sorted imports with isort.
4. Changed deprecated `log.warn` => `log.warning`.
2020-04-06 15:16:56 +05:00
Michael Terry
7999bdfbe9 Fix error in verification email command
We are seeing an error in the send_verification_expiry_email job
because one verification model instance had a null expiry_date but
a non-null expery_email_date.

This makes us more robust to that odd data and makes the job more
robust by having it still send other emails out even if one fails.

AA-70
2020-03-20 11:32:03 -04:00
Matt Hughes
acce8baca4 Add management command for retroactively adding sso IdV for IdP
We sometimes update preexisting SAML SSO providers to configure them
to automatically create SSO identity verification (IdV) records when a
learner links an account via that provider. Turning that configuration
from off to on does make it such that when learners log back in via
their linked account, a new IdV record will be created for them. But
it's possible we'd want this process to happen more automatically and
seamlessly, for which this management command will be helpful.

Note that this does not help with removing SSO verification records
for a provider for which this configuration has been turned off.

JIRA:EDUCATOR-4947
2020-03-17 16:04:24 -04:00
Awais Qureshi
220cab965f BOM-1126
Removing the moto from repo.
2020-01-15 22:34:13 +05:00
Mahyar Damavand
f1c5981fab Removing deprecated management commands which intended to clear historical data (#21522) 2020-01-08 12:50:34 -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
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
Giovanni Cimolin da Silva
d1aeec45ad Remove flaky test related to MockS3Mixin
The MockS3Mixin prevents the correct setup of the ModuleStoreTestCase 
and made this test fail. Since the fix for this wasn't trivial, this 
test was skipped on python 3, and now is removed.
2019-12-27 09:59:25 -03:00
Feanil Patel
f359c9cd8f Merge pull request #21197 from open-craft/giovanni/upgrade-pymongo
BB-1744: Bump pymongo version and fix course export issue
2019-12-26 11:16:15 -05:00
Alan Zarembok
be8fef3513 PROD-1113: Fix retry_failed_photo_verifications to work when no database arguments exist. 2019-12-20 17:52:03 -05:00
Feanil Patel
3808b2991c Ensure that photo verification data is correctly typed.
There were cases where we needed to encode things to codecs other than
ascii.  In these cases, python returns byte strings but we needed them
to be unicode so that they serialize correctly later when we combine
them with other unicode strings.
2019-12-18 13:54:37 -05:00
Giovanni Cimolin da Silva
5983d5dd42 Skip test on python 3 2019-12-11 13:54:34 -03:00
Adeel Khan
2b80fdbf66 Automate retry_failed_photo_verification mgt command
This patch would enable a user to run management
command via jenkins job. Verification ids
are injected via a configuration model.

PROD-1005
2019-12-10 16:53:12 +05:00
Zainab Amir
f6603cb8cf Update verification expiry email criteria (#20725)
If already DEFAULT Number of emails are sent, then verify that user
is enrolled in at least one verified course run for which the course
has not ended else stop sending emails

LEARNER-7313
2019-07-03 14:19:22 +05:00
Zainab Amir
886834adb5 Move command arguments to common settings
Move command parameter arguments, resend-days and days-range, to
common settings. This will help in creating a consistency when the
default values are changed in the future.

LEARNER-7313
2019-05-28 14:49:27 +05:00
Stu Young
99bef9ecfa incr-295 (#20602)
* run python modernize

* run isort
2019-05-15 15:20:26 -04:00
Jeremy Bowman
097807dc49 Fix time zone bug in send_verification_expiry_email (#20350) 2019-04-30 13:00:55 -04:00
Zainab Amir
d39b150d3b Fix Flaky test in TestSendVerificationExpiryEmail
datetime.now(UTC) gives unexpected results. Using "now()" function
from django.utils.timezone tends to be a much more reliable way to
get a time zone aware timestamp for the current time.

PROD-190
2019-04-18 10:55:48 +05:00
Zainab Amir
2471c12cc4 Get current site by ID
Getting current site by NAME was failing on stage.

LEARNER-5408
2019-04-08 12:54:34 +05:00
Zainab Amir
2dbae49869 LEARNER-6946 management command to send verification expiry email
Template for email added (email/verification_expiry_email)
The management command filters the SoftwareSecurePhotoVerification model on the basis of following criteria :
-- the verification is approved
-- the start_date < expiry_date < today or specified days have passed to resend email
After the basic filtering batches are created to send email. For each verification in a batch email is sent and
email_expiry_date is set to 15 days from today (default days are 15, it can be changed too)
Between each batch there is a delay of sleep_time seconds
2019-03-07 14:31:27 +05:00
Zainab Amir
66b780d693 LEARNER-7136 populate expiry date and add mechanism for new verification
Method approve() is overridden to accommodate new users that will have their verification approved in the future.
The approve() method is called from software secure results callback every time a Software Secure Photo Verification
is approved.The method overridden now updates expiry_date and then calls super to perform task it was performing
before this change.The expiry_date set is the same as the one sent in verification approval email.

In results_callback for sspv the expiry_date and expiry_email_date for the most recent previous verification if exists
are also updated to NULL.
2019-03-06 18:41:30 +05:00
Simon Chen
1f491b4190 Revert "LEARNER-6945 Populate software secure photo verification"
This reverts commit 019f6c4dcf.
2019-02-26 14:13:58 -05:00
Zainab Amir
019f6c4dcf LEARNER-6945 Populate software secure photo verification 2019-02-22 11:01:57 +05:00
Calen Pennington
8c53ce6493 Merge pull request #19743 from edx/unicode7
fix unicode strings in lms/ part 2
2019-02-13 14:15:02 -05:00
Matthew Piatetsky
764319d3e0 fix unicode strings in lms/ part 2 2019-02-13 10:35:56 -05:00
Michael Youngstrom
3221c2b91f Remove lms pytest shards 2019-02-12 11:03:46 -05:00
cclauss
8fca11b85c Use print() function in both Python 2 and Python 3 2019-01-13 17:16:37 +01:00
Jeremy Bowman
bcaec3c5bb TE-2525 nose.tools removal part 1/2 2018-08-07 08:30:12 -04:00
irfanuddinahmad
a46a28e983 incorporated manual verification 2018-06-25 12:08:54 +05:00