Merge pull request #13147 from edx/release

Release
This commit is contained in:
mikedikan
2016-08-02 12:29:39 -04:00
committed by GitHub
21 changed files with 37 additions and 792 deletions

View File

@@ -4,13 +4,12 @@ import sys
from functools import wraps
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.cache import caches
from django.core.validators import ValidationError, validate_email
from django.views.decorators.csrf import requires_csrf_token
from django.views.defaults import server_error
from django.http import (Http404, HttpResponse, HttpResponseNotAllowed,
HttpResponseServerError, HttpResponseForbidden)
HttpResponseServerError)
import dogstats_wrapper as dog_stats_api
from edxmako.shortcuts import render_to_response
import zendesk
@@ -22,8 +21,6 @@ import track.views
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from student.roles import GlobalStaff
log = logging.getLogger(__name__)
@@ -47,21 +44,6 @@ def ensure_valid_course_key(view_func):
return inner
def require_global_staff(func):
"""View decorator that requires that the user have global staff permissions. """
@wraps(func)
def wrapped(request, *args, **kwargs): # pylint: disable=missing-docstring
if GlobalStaff().has_user(request.user):
return func(request, *args, **kwargs)
else:
return HttpResponseForbidden(
u"Must be {platform_name} staff to perform this action.".format(
platform_name=settings.PLATFORM_NAME
)
)
return login_required(wrapped)
@requires_csrf_token
def jsonable_server_error(request, template_name='500.html'):
"""

View File

@@ -234,6 +234,18 @@ class TestCreateYoutubeString(VideoDescriptorTestBase):
self.assertEqual(create_youtube_string(self.descriptor), expected)
class TestCreateYouTubeUrl(VideoDescriptorTestBase):
"""
Tests for helper method `create_youtube_url`.
"""
def test_create_youtube_url_unicode(self):
"""
Test that passing unicode to `create_youtube_url` doesn't throw
an error.
"""
self.descriptor.create_youtube_url(u"üñîçø∂é")
@ddt.ddt
class VideoDescriptorImportTestCase(unittest.TestCase):
"""

View File

@@ -619,9 +619,9 @@ class VideoDescriptor(VideoFields, VideoTranscriptsMixin, VideoStudioViewHandler
A full youtube url to the video whose ID is passed in
"""
if youtube_id:
return 'https://www.youtube.com/watch?v={0}'.format(youtube_id)
return u'https://www.youtube.com/watch?v={0}'.format(youtube_id)
else:
return ''
return u''
def get_context(self):
"""