change devices for tags in printlabels
This commit is contained in:
parent
f299367ba7
commit
bf42a79ef7
|
@ -64,10 +64,7 @@ class PrintLabelsForm(FlaskForm):
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
|
|
||||||
# print only tags that are DHID
|
if not self._devices:
|
||||||
dhids = [x.devicehub_id for x in self._devices]
|
return False
|
||||||
self._tags = (
|
|
||||||
Tag.query.filter(Tag.owner_id == g.user.id).filter(Tag.id.in_(dhids)).all()
|
|
||||||
)
|
|
||||||
|
|
||||||
return is_valid
|
return is_valid
|
||||||
|
|
|
@ -102,7 +102,7 @@ class PrintLabelsView(View):
|
||||||
form = PrintLabelsForm()
|
form = PrintLabelsForm()
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
context['form'] = form
|
context['form'] = form
|
||||||
context['tags'] = form._tags
|
context['devices'] = form._devices
|
||||||
return flask.render_template(self.template_name, **context)
|
return flask.render_template(self.template_name, **context)
|
||||||
else:
|
else:
|
||||||
messages.error('Error you need select one or more devices')
|
messages.error('Error you need select one or more devices')
|
||||||
|
|
Reference in New Issue