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

Random current_team is not set. Use X-PRESS-TEAM header in the request to set it. error in dashboard #2168

Open
BreadGenie opened this issue Sep 20, 2024 · 0 comments
Assignees

Comments

@BreadGenie
Copy link
Member

BreadGenie commented Sep 20, 2024

Relevant code

press/press/overrides.py

Lines 86 to 88 in 7b20a81

def before_request():
frappe.local.team = _get_current_team
frappe.local.system_user = _system_user

let request = options => {
let _options = options || {};
_options.headers = options.headers || {};
let currentTeam = localStorage.getItem('current_team') || window.default_team;
if (currentTeam) {
_options.headers['X-Press-Team'] = currentTeam;
}
return frappeRequest(_options);
};
setConfig('resourceFetcher', request);

Did some preliminary investigation on triggering of this error and it seems like the necessary team data exists in the front end (localStorage). Needs to check if we missed a case in the backend.

@BreadGenie BreadGenie self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant