mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-16 16:33:12 +00:00
Move printing_path from models to utils
This commit is contained in:
parent
471165194b
commit
56ca2c47a4
2 changed files with 2 additions and 11 deletions
|
@ -18,6 +18,8 @@ from re2o.mixins import RevMixin
|
||||||
|
|
||||||
import users.models
|
import users.models
|
||||||
|
|
||||||
|
import unidecode
|
||||||
|
|
||||||
from .validators import (
|
from .validators import (
|
||||||
FileValidator,
|
FileValidator,
|
||||||
)
|
)
|
||||||
|
@ -33,7 +35,6 @@ from .settings import (
|
||||||
PERFORATION_OPTIONS,
|
PERFORATION_OPTIONS,
|
||||||
)
|
)
|
||||||
|
|
||||||
from .utils import user_printing_path
|
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
import unidecode
|
|
||||||
|
|
||||||
from django.template.loader import get_template
|
from django.template.loader import get_template
|
||||||
from django.core.mail import EmailMessage
|
from django.core.mail import EmailMessage
|
||||||
|
@ -12,15 +11,6 @@ from numpy.random import randint
|
||||||
|
|
||||||
import datetime
|
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):
|
def pdfinfo(file_path):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue