Fix #701 Preferable default theme
#746
Samengevoegd
KitaitiMakoto
heeft 3 commits samengevoegd van preferred-default-theme
naar master
4 jaren geleden
Laden…
Verwijs in nieuw issue
Er is nog geen inhoud.
Verwijder branch 'preferred-default-theme'
Het verwijderen van een branch is permanent. Het KAN NIET ongedaan gemaakt worden. Wil je toch doorgaan?
This patch fixes #701 .
The issue occurs because form value of
email
is empty string""
when user selects "Default theme" and it is set as preferred theme name. There's no theme named""
, so any theme is not applied. By settingNULL
tousers.preferred_theme
when "Default theme" is selected, instance theme is used as the user's preferred theme.I used Diesel's
#[changeset_options(treat_none_as_null="true")]
attribute onUser
model. This may not be preferred butsave_changes
doesn't have option to setNULL
sometimes and keep current value otherwise(See http://diesel.rs/guides/all-about-updates/ . It says "Diesel doesn't currently provide a way to explicitly assign a field to its default value"). This is the reason why I used that attribute, but it may have too wide inpact. Could you consider?Codecov Report
I did a quick check to see if it could impact something else, but it looks like it is safe. Thanks for contributing!
Woops, forgot to approve
Thank you for merging!
Sadly a new user of mine still just ran into missing CSS on 0.5.0 :(
@verymilan Can you re-save configuration again, please?
I am not sure what you mean, but as usual, i have made them selecting a theme and save, which was fixing their issue as always
Sorry for my poor English. What I did mean is...
Can you have your users select "Default theme" and save it? It might be fix the issue?
Under the hood, their current theme is saved as empty string
""
but re-saving theme makes itNULL
. And then default theme is applied.Yes, i know, and this is how we did it - i was just ~expecting~ assuming that this workaround wasn't needed anymore.
Ah, sorry, I missed your point.
Yes, your realization is correct.
Reviewers
b834d1c282
.Stap 1:
Vanuit het project, check een branch uit en test de veranderingen.Stap 2:
Voeg de wijzigingen samen en update ze op Forgejo.