'Sets the user defined in settings.HARDTREE_DEFAULT_USER_ID and default mode'

def set_default_user(self):

    try:
        user = User.objects.get(pk=settings.HARDTREE_DEFAULT_USER_ID)
    except:
        try:
            user = User.objects.all()[0]
        except IndexError:
            user = None
    self.set_user(user)
    return self
