Changeset 7fab472 in tailbone


Ignore:
Timestamp:
03/13/19 12:49:54 (6 months ago)
Author:
Lance Edgar <ledgar@…>
Branches:
master
Children:
c8695164
Parents:
f755aef
Message:

Add "time ago" for "product already receieved" alert on mobile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tailbone/views/purchasing/receiving.py

    rf755aef r7fab472  
    3131
    3232import six
     33import humanize
    3334import sqlalchemy as sa
    3435
     
    3738from rattail.db.util import maxlen
    3839from rattail.gpc import GPC
    39 from rattail.time import localtime
     40from rattail.time import localtime, make_utc
    4041from rattail.util import pretty_quantity, prettify, OrderedDict
    4142from rattail.vendors.invoices import iter_invoice_parsers, require_invoice_parser
     
    15621563        if alert_received:
    15631564            if self.handler.get_units_confirmed(row):
    1564                 self.request.session.flash("You have already received some of this product.", 'receiving-warning')
     1565                msg = "You have already received some of this product; last update was {}.".format(
     1566                    humanize.naturaltime(make_utc() - row.modified))
     1567                self.request.session.flash(msg, 'receiving-warning')
    15651568
    15661569        return self.render_to_response('receive_row', context, mobile=True)
Note: See TracChangeset for help on using the changeset viewer.