Switch to unified view

a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
...
...
619
        for i, prefix in enumerate(prefixes):
619
        for i, prefix in enumerate(prefixes):
620
            unit = base ** (i + 2)
620
            unit = base ** (i + 2)
621
            if bytes < unit:
621
            if bytes < unit:
622
                return '%.1f %s' % ((base * bytes / unit), prefix)
622
                return '%.1f %s' % ((base * bytes / unit), prefix)
623
        return '%.1f %s' % ((base * bytes / unit), prefix)
623
        return '%.1f %s' % ((base * bytes / unit), prefix)
624
625
626
def log_if_changed(artifact, attr, new_val, message):
627
    """Set `artifact.attr` to `new_val` if changed. Add AuditLog record."""
628
    from allura import model as M
629
    if not hasattr(artifact, attr):
630
        return
631
    if getattr(artifact, attr) != new_val:
632
        M.AuditLog.log(message)
633
        setattr(artifact, attr, new_val)