Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve handling deleted GH users #1161

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Dec 15, 2023

  1. fix(events): init EventUser only if actor is defined

    Prevents the following TypeError with events of deleted users (aka "ghost"):
    
    ```
      File "/path/to/github3/models.py", line 52, in __init__
        self._update_attributes(json)
      File "/path/to/github3/issues/event.py", line 63, in _update_attributes
        self.actor = users.ShortUser(event["actor"], self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/path/to/github3/models.py", line 52, in __init__
        self._update_attributes(json)
      File "/path/to/github3/users.py", line 309, in _update_attributes
        self.avatar_url = user["avatar_url"]
    
    TypeError: 'NoneType' object is not subscriptable
    ```
    caugner authored and sigmavirus24 committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    17a46e3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b3bb35f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9879aeb View commit details
    Browse the repository at this point in the history
  4. fix(pulls): handle repo["owner"] == None

    `owner` is null if the user who opened the PR
    no longer exists on GitHub.
    caugner authored and sigmavirus24 committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    6d15a77 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    69414a0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    35ce354 View commit details
    Browse the repository at this point in the history