* feat: global `frappe.in_test` flag
* feat: helper utility to toggle `frappe.in_test`
* fix: use `toggle_test_mode` util
* fix: use `frappe.in_test`
* chore: add comment explaining global `in_test`
* chore: ignore commit replacing flag usage
* test: temporarily disable `frappe.in_test`
this worked earlier because flag was set in werkzeug.local which was separate for API test client
* test: add comment explaining change
* fix: logout to site login page if the site is on Frappe Cloud
* fix: check if the site user is logged in before rendering trial banner
* fix: show dropdown even if the site is not on trial plan
* refactor: don't expose communication secret in boot
* feat: show install app button for fc sites
* fix: remove auth from desk
we can simplify it and let user do auth in fc
* fix: install app button condition
* refactor: use `is_fc_site` method
* fix: return boolean value for `is_fc_site` function
* fix: add install app button in /apps page
* fix: don't generate otp for login to fc
* fix: remove install app option from desk
* fix: design changes for trial banner
* fix: add more details to the `current_site_info` endpoint
also don't render trial banner if trial end date is passed
* fix: don't route user to welcome page
always put them on the site's dashboard
* fix: override base_url when needed
also remove misleading class
* fix: show banner to normal user to contact system admin for plan upgrade
* refactor: redirect from /login instead of every /logout code
* fix: rename login to fc to manage billing
also move it above the divider
* refactor: separate out site-login url from login.py
This was always broken apparantly. Cache key only contains the path so
querystring is being ignored. If request has query params then we
shouldn't cache it.
WIP - better solution for caching based on cache headers. Anyway this
caching isn't THAT helpful since #29170
There are cases where certain social login keys
- Should not allow signups at all and only allow logins. E.g. social media login keys.
- Should allow signups even if global sign ups are disabled. e.g. internal SSO like setups.
| Metric | Before | After | Change |
| --- | --- | --- | --- |
| app.html first response size | 421kb | 106kb | -75% (!) |
| First response duration | 60ms | 40ms | -33% |
huge thanks to @cogk for doing most of the work for this PR on this issue: https://github.com/frappe/frappe/issues/17449#issuecomment-1728328726
Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
test: change code to adapt to new werkzeug client
fix: avoid setting charset
utf8 is default and assumed now by werkzeug, setting this manually is
deprecated.
fix: use string instead of bytes for setting headers
DeprecationWarning: Passing bytes as a header value is deprecated and will not be supported in Werkzeug 3.0.
12:23:34 web.1 | response.headers["X-Page-Name"] = path.encode("ascii", errors="xmlcharrefreplace")
Each call to evaluate if route is web view makes N queries where N = #
of web view doctypes. This entire computation can be definitely cached
for short duration.
- Added cache bursting in WebsiteGenerator doctype updates.
- Added 60 minutes TTL in case cache invalidation wasn't done reliably.
We parse entire response to find preload headers, instead just use
include_style and include_script to include assets directly into preload
headers. This shaves off ~13% overhead in response.
refactor: clean up code to py39+ supported syntax
- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes
Powered by https://github.com/asottile/pyupgrade/ + manual cleanups