Use print() function in both Python 2 and Python 3

This commit is contained in:
cclauss
2019-01-13 17:16:37 +01:00
parent 77bc40fe95
commit 8fca11b85c
56 changed files with 300 additions and 244 deletions

View File

@@ -10,6 +10,7 @@ file and check it in at the same time as your model changes. To do that,
2. ./manage.py lms schemamigration student --auto description_of_your_change
3. Add the migration file created in edx-platform/common/djangoapps/student/migrations/
"""
from __future__ import print_function
import hashlib
import json
import logging
@@ -2148,12 +2149,12 @@ def get_user(email):
def user_info(email):
user, u_prof = get_user(email)
print "User id", user.id
print "Username", user.username
print "E-mail", user.email
print "Name", u_prof.name
print "Location", u_prof.location
print "Language", u_prof.language
print("User id", user.id)
print("Username", user.username)
print("E-mail", user.email)
print("Name", u_prof.name)
print("Location", u_prof.location)
print("Language", u_prof.language)
return user, u_prof
@@ -2170,8 +2171,8 @@ def change_name(email, new_name):
def user_count():
print "All users", User.objects.all().count()
print "Active users", User.objects.filter(is_active=True).count()
print("All users", User.objects.all().count())
print("Active users", User.objects.filter(is_active=True).count())
return User.objects.all().count()