py3: use new print syntax

This commit is contained in:
Benjamin Dauvergne 2019-03-28 19:25:42 +01:00
parent dd3801ed69
commit 526a17c33c
1 changed files with 3 additions and 2 deletions

View File

@ -16,6 +16,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
import datetime
from django.core.management.base import BaseCommand
@ -30,7 +31,7 @@ class Command(BaseCommand):
self.options = options
self.clean_journal()
def clean_journal(self, verbosity=1):
def clean_journal(self):
'''Supprime les entrées du journal plus vieilles que ZOO_NANTERRE_LOG_EXPIRATION_DAYS'''
duration = datetime.timedelta(days=settings.ZOO_NANTERRE_LOG_EXPIRATION_DAYS)
n = now()
@ -38,4 +39,4 @@ class Command(BaseCommand):
threshold = n - duration
count, count_by_class = Log.objects.filter(timestamp__lt=threshold).delete()
if count and self.options['verbosity'] > 0:
print 'Suppression de %d entrées du journal.' % count
print('Suppression de %d entrées du journal.' % count)