P5-3538 do not create eSales importfile after saving a category

This commit is contained in:
Martin
2019-01-29 14:07:56 +01:00
parent f680f0bcc3
commit 3374feee0e
3 changed files with 1 additions and 44 deletions
-21
View File
@@ -1,7 +1,6 @@
# coding=UTF-8
from api.extensions import db
from api.lib.slugify import slugify
from api.models.locale import Locale
@@ -13,16 +12,6 @@ class Category(db.Model):
texts = db.relationship(
'CategoryTexts', backref='category', lazy='dynamic')
def path(self, locale='sv_SE'):
row = CategoryTreeI18n.query.filter_by(
category_id=self.id, locale=locale).first()
if not row:
raise Exception(
'Could not find a path for category: {}, locale: {}'.format(self.id, locale))
path = row.path.split('/', 1)[-1] # get all text after the first /
path = slugify(path)
return path
def to_json(self):
return {
'id': self.id,
@@ -62,13 +51,3 @@ class CategoryTexts(db.Model):
'design_wallpaper_h1': self.design_wallpaper_h1,
'design_wallpaper_description': self.design_wallpaper_description,
}
class CategoryTreeI18n(db.Model):
__tablename__ = 'v_categorytree_i18n'
category_id = db.Column('id', db.Integer)
path = db.Column(db.String(250))
locale = db.Column(db.String(250))
__table_args__ = (db.PrimaryKeyConstraint(category_id, locale),)