Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cms/envs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
COMPREHENSIVE_THEME_DIRS,
JWT_AUTH,
REGISTRATION_EXTRA_FIELDS,
ECOMMERCE_API_URL,
)

# Allow all hosts during tests, we use a lot of different ones all over the codebase.
Expand Down
1 change: 1 addition & 0 deletions cms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
LIBRARY_KEY_PATTERN = r'(?P<library_key_string>library-v1:[^/+]+\+[^/+]+)'

urlpatterns = [
url(r'', include('openedx.core.djangoapps.user_authn.urls_common')),
url(r'', include('student.urls')),
url(r'^transcripts/upload$', contentstore.views.upload_transcripts, name='upload_transcripts'),
url(r'^transcripts/download$', contentstore.views.download_transcripts, name='download_transcripts'),
Expand Down
14 changes: 0 additions & 14 deletions common/djangoapps/student/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
from django.db import IntegrityError, transaction
from django.utils import http
from django.utils.translation import ugettext as _
from oauth2_provider.models import AccessToken as dot_access_token
from oauth2_provider.models import RefreshToken as dot_refresh_token
from provider.oauth2.models import AccessToken as dop_access_token
from provider.oauth2.models import RefreshToken as dop_refresh_token
from pytz import UTC
from six import iteritems, text_type
import third_party_auth
Expand Down Expand Up @@ -372,16 +368,6 @@ def get_redirect_to(request):
return redirect_to


def destroy_oauth_tokens(user):
"""
Destroys ALL OAuth access and refresh tokens for the given user.
"""
dop_access_token.objects.filter(user=user.id).delete()
dop_refresh_token.objects.filter(user=user.id).delete()
dot_access_token.objects.filter(user=user.id).delete()
dot_refresh_token.objects.filter(user=user.id).delete()


def generate_activation_email_context(user, registration):
"""
Constructs a dictionary for use in activation email contexts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from student.forms import AccountCreationForm
from student.helpers import do_create_account
from student.models import CourseEnrollment, create_comments_service_user
from student.views import AccountValidationError
from student.helpers import AccountValidationError
from track.management.tracked_command import TrackedCommand


Expand Down
2 changes: 1 addition & 1 deletion common/djangoapps/student/tests/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def test_send_email_to_inactive_user(self, mock_log):
)


@patch('student.views.login.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
@patch('student.views.management.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
@patch('django.contrib.auth.models.User.email_user')
class ReactivationEmailTests(EmailTestMixin, CacheIsolationTestCase):
"""
Expand Down
2 changes: 1 addition & 1 deletion common/djangoapps/student/tests/test_password_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from openedx.core.djangoapps.external_auth.models import ExternalAuthMap
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
from student.views import create_account
from openedx.core.djangoapps.user_authn.views.deprecated import create_account


@patch.dict("django.conf.settings.FEATURES", {'ENFORCE_PASSWORD_POLICY': True})
Expand Down
2 changes: 1 addition & 1 deletion common/djangoapps/student/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from openedx.core.djangoapps.content.course_overviews.tests.factories import CourseOverviewFactory
from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration_context
from pyquery import PyQuery as pq
from student.cookies import get_user_info_cookie_data
from openedx.core.djangoapps.user_authn.cookies import get_user_info_cookie_data
from student.helpers import DISABLE_UNENROLL_CERT_STATES
from student.models import CourseEnrollment, UserProfile
from student.signals import REFUND_ORDER
Expand Down
19 changes: 1 addition & 18 deletions common/djangoapps/student/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,9 @@
from . import views

urlpatterns = [
url(r'^logout$', views.LogoutView.as_view(), name='logout'),

# TODO: standardize login

# login endpoint used by cms.
url(r'^login_post$', views.login_user, name='login_post'),
# login endpoints used by lms.
url(r'^login_ajax$', views.login_user, name="login"),
url(r'^login_ajax/(?P<error>[^/]*)$', views.login_user),

url(r'^email_confirm/(?P<key>[^/]*)$', views.confirm_email_change, name='confirm_email_change'),

url(r'^create_account$', views.create_account, name='create_account'),
url(r'^activate/(?P<key>[^/]*)$', views.activate_account, name="activate"),

url(r'^accounts/disable_account_ajax$', views.disable_account_ajax, name="disable_account_ajax"),
Expand All @@ -31,26 +21,19 @@
url(r'^change_email_settings$', views.change_email_settings, name='change_email_settings'),

# password reset in views (see below for password reset django views)
url(r'^account/password$', views.password_change_request_handler, name='password_change_request'),
url(r'^password_reset/$', views.password_reset, name='password_reset'),
url(
r'^password_reset_confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
views.password_reset_confirm_wrapper,
name='password_reset_confirm',
),

url(r'accounts/verify_password', views.verify_user_password, name='verify_password'),

url(r'^course_run/{}/refund_status$'.format(settings.COURSE_ID_PATTERN),
views.course_run_refund_status,
name="course_run_refund_status"),
]

# enable automatic login
if settings.FEATURES.get('AUTOMATIC_AUTH_FOR_TESTING'):
urlpatterns += [
url(r'^auto_auth$', views.auto_auth),
]

# password reset django views (see above for password reset views)
urlpatterns += [
# TODO: Replace with Mako-ized views
Expand Down
1 change: 0 additions & 1 deletion common/djangoapps/student/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

# pylint: disable=wildcard-import
from dashboard import *
from login import *
from management import *
2 changes: 1 addition & 1 deletion common/djangoapps/student/views/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from openedx.features.journals.api import journals_enabled
from shoppingcart.api import order_history
from shoppingcart.models import CourseRegistrationCode, DonationConfiguration
from student.cookies import set_user_info_cookie
from openedx.core.djangoapps.user_authn.cookies import set_user_info_cookie
from student.helpers import cert_info, check_verify_status_by_course
from student.models import (
CourseEnrollment,
Expand Down
Loading