'Return the percentage of any storage quota applicable to the user/transaction.'

def get_percent(self, trans=None, user=False, history=False, usage=False, quota=False):

    if trans:
        user = trans.user
        history = trans.history
    if (quota is False):
        quota = self.get_quota(user)
    if (quota is None):
        return None
    if (usage is False):
        usage = self.get_usage(trans, user, history)
    try:
        return min((int(((float(usage) / quota) * 100)), 100))
    except ZeroDivisionError:
        return 100
