1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-09 18:25:58 +01:00

Fix handling of AutoSubgroups in readDescriptionFile.

We used to test AutoSubgroups before upgrading the description,
which would break handling of the (obsolete) AllowSubgroups
field.

Thanks to David Saulpic.
This commit is contained in:
Juliusz Chroboczek 2024-04-17 18:48:53 +02:00
parent 19dfccc3d5
commit 841d95d21c

View file

@ -441,6 +441,15 @@ func readDescription(name string, allowSubgroups bool) (*Description, error) {
if err != nil {
return nil, err
}
err = upgradeDescription(&desc)
if err != nil {
return nil, err
}
desc.FileName = fileName
desc.fileSize = fi.Size()
desc.modTime = fi.ModTime()
if isSubgroup {
if !desc.AutoSubgroups {
return nil, os.ErrNotExist
@ -450,15 +459,6 @@ func readDescription(name string, allowSubgroups bool) (*Description, error) {
desc.Description = ""
}
desc.FileName = fileName
desc.fileSize = fi.Size()
desc.modTime = fi.ModTime()
err = upgradeDescription(&desc)
if err != nil {
return nil, err
}
return &desc, nil
}