django-sql-explorer icon indicating copy to clipboard operation
django-sql-explorer copied to clipboard

AttributeError will be raised if User is not using email.

Open moonwalkerpoday opened this issue 1 year ago • 2 comments

I am using a custom user that inherits from AbstractBaseUser and I get an AttributeError.

image

The reason is that the email is referenced in the created_by_user_email method of the QueryForm.

...
    @property
    def created_by_user_email(self):
        return self.instance.created_by_user.email if \
            self.instance.created_by_user else '--'
...

I think it is better not to fix it to email, because there are cases where email is not used. I will create a pull request, any other ideas or opinions? thank you

moonwalkerpoday avatar Sep 22 '23 12:09 moonwalkerpoday