Commit 32ac9578 authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

[widgets][editor] ensure max length for short description field

parent e6f43d2e
......@@ -24,6 +24,7 @@
###############################################################################
import simplejson as json
import pkg_resources
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import pyqtSlot
......@@ -67,6 +68,11 @@ class AbstractAssetEditor(QWidget):
self.context = None
self.asset_type = asset_type
self.schema_version = None
common_data = pkg_resources.resource_string("beat.core", "schema/common/1.json")
common_data = json.loads(common_data)
definitions = common_data["definitions"]
description = definitions["description"]
description_length = description["maxLength"]
self.clearDirty()
......@@ -74,6 +80,7 @@ class AbstractAssetEditor(QWidget):
self.title_label = QLabel(self.tr("Unknown"))
self.description_lineedit = QLineEdit()
self.description_lineedit.setMaxLength(description_length)
self.information_group_box = QGroupBox(self.tr("Information"))
self.information_layout = QFormLayout(self.information_group_box)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment