mirror of
https://github.com/jech/galene.git
synced 2024-11-22 08:35:57 +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:
parent
19dfccc3d5
commit
841d95d21c
1 changed files with 9 additions and 9 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue