Fix rbt patch when applying patches from users with private profiles.
Review Request #10314 — Created Nov. 8, 2018 and submitted
If a user has marked their profile private, their full name and e-mail
address will be stripped from the API payloads. This would cause
rbt patch -c/-C
to fail with an AttributeError when attempting to
create the commit.This change fixes it so we create the commit as the running user.
Applied a patch from a user who had marked their profile private.
-
-
This works but I feel there's room for improvement (maybe going forward, rather than right now).
Mainly:
- There's duplicate logic here, that's going to eventually become inconsistent as it gets duplicated further. It'd be really nice to have some centralized logic (maybe a utility method that can be called to figure all this out).
- It'd be nice to also warn when we can't commit as the user, so it's not a surprise when they're not credited as the author in the commit. A centralized method can help with this.
-
-