]> git.aero2k.de Git - sirius.git/commitdiff
Only show messages for the selected printer.
authorTom Hunger <tehunger@gmail.com>
Thu, 22 Jan 2015 17:39:38 +0000 (17:39 +0000)
committerTom Hunger <tehunger@gmail.com>
Thu, 22 Jan 2015 17:39:38 +0000 (17:39 +0000)
Also make that the default printer when going to the print page.

sirius/web/printer_overview.py
sirius/web/printer_print.py

index eb557ade0400aa4dffb0b6139d126aa468ce02d7..055a2277583cd61d4df913b1067436e8bab5c9bd 100644 (file)
@@ -19,7 +19,7 @@ def printer_overview(user_id, username, printer_id):
         flask.abort(404)
 
     messages.Message.timeout_updates()
-    message_list = login.current_user.messages.order_by(desc('created'))
+    message_list = printer.messages.order_by(desc('created'))
 
     # TODO - pagination?
     return flask.render_template(
index ab0fbd0784af17cc13168176e9a76407d6de3dfb..505f5a50930dddfca3df7aa6dc6cb651d35ee86c 100644 (file)
@@ -41,6 +41,7 @@ def printer_print(user_id, username, printer_id):
     # submit a valid printer-id that's not owned by the user:
     form.target_printer.choices = [
         (x.id, x.name) for x in login.current_user.printers.all()]
+    form.target_printer.data = printer.id
 
     if form.validate_on_submit():
         flask.flash('Sent your message to the printer!')