Skip to content

Resource model 'user' field is Optional[User] but it is required. #4321

Closed
@marrobi

Description

All resources get a value for user, however this is done on save, rather than creation of the object. We should refactor so that the user property gets set on creation of the object, and remove the Optional form here.


The 'user' field is Optional[User], but there is no null check before accessing its attributes. This could lead to an AttributeError if 'user' is None. Add a null check before accessing 'user' attributes.

Originally posted by @Copilot in #3770 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions