'Save the user who created and modified invoice transactions.'

def save_formset(self, request, form, formset, change):

    instances = formset.save(commit=False)
    for instance in instances:
        if isinstance(instance, InvoiceTransaction):
            if (not hasattr(instance, 'created_by')):
                instance.created_by = request.user
            instance.last_modified_by = request.user
            instance.save()
