diff --git a/.claude/skills/worktree/SKILL.md b/.claude/skills/worktree/SKILL.md index 50f8fb5e51..a1339a29b3 100644 --- a/.claude/skills/worktree/SKILL.md +++ b/.claude/skills/worktree/SKILL.md @@ -26,7 +26,10 @@ Create isolated worktrees for parallel development. Ends by providing commands t ```bash git fetch origin main mkdir -p "$(dirname "$WORKTREE_PATH")" - git worktree add -b "{branch}" "$WORKTREE_PATH" origin/main + # --no-track: do NOT set the new branch's upstream to origin/main. + # Without it, a later `git push -u origin {branch}` can be reported by + # the server as also fast-forwarding main, landing commits on main. + git worktree add --no-track -b "{branch}" "$WORKTREE_PATH" origin/main ``` 4. **Copy config files** diff --git a/backend/account_v2/authentication_controller.py b/backend/account_v2/authentication_controller.py index 56982ed9b7..d27bb50656 100644 --- a/backend/account_v2/authentication_controller.py +++ b/backend/account_v2/authentication_controller.py @@ -3,6 +3,7 @@ from django.conf import settings from django.contrib.auth import logout as django_logout +from django.db import transaction from django.db.utils import IntegrityError from django.http import HttpRequest from django.middleware import csrf @@ -100,8 +101,8 @@ def authorization_callback( return self.auth_service.handle_authorization_callback( request=request, backend=backend ) - except Exception as ex: - logger.error(f"Error while handling authorization callback: {ex}") + except Exception: + logger.exception("Error while handling authorization callback") return redirect("/error") def user_organizations(self, request: Request) -> Any: @@ -163,6 +164,7 @@ def user_organizations(self, request: Request) -> Any: return response + @transaction.atomic def set_user_organization(self, request: Request, organization_id: str) -> Response: user: User = request.user new_organization = False