8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-05 09:26:27 +00:00

Move printing_path from models to utils

This commit is contained in:
Maxime Bombar 2018-09-25 13:39:12 +02:00 committed by root
parent 471165194b
commit 56ca2c47a4
2 changed files with 2 additions and 11 deletions

View file

@ -18,6 +18,8 @@ from re2o.mixins import RevMixin
import users.models
import unidecode
from .validators import (
FileValidator,
)
@ -33,7 +35,6 @@ from .settings import (
PERFORATION_OPTIONS,
)
from .utils import user_printing_path
import math

View file

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import subprocess
import os
import unidecode
from django.template.loader import get_template
from django.core.mail import EmailMessage
@ -12,15 +11,6 @@ from numpy.random import randint
import datetime
def user_printing_path(instance, filename):
"""
Defines the path where will be uploaded the files
Currently MEDIA_ROOT/printings/user_<id>/<filename>
"""
# File will be uploaded to MEDIA_ROOT/printings/user_<id>/<filename>
return 'printings/user_{0}/{1}'.format(instance.user.id, unidecode.unidecode(filename))
def pdfinfo(file_path):
"""