Exlicitly get the pseudonamespace with all shared lists #32

Merged
konrad merged 2 commits from feature/get-namespace-with-shared-lists into master 2018-12-04 10:16:42 +00:00
1 changed files with 8 additions and 7 deletions
Showing only changes of commit 0b2e2adb8d - Show all commits

View File

@ -37,6 +37,7 @@ type Namespace struct {
web.Rights `xorm:"-" json:"-"`
}
// PseudoNamespace is a pseudo namespace used to hold shared lists
var PseudoNamespace = Namespace{
ID: -1,
Name: "Shared Lists",
@ -63,14 +64,14 @@ func GetNamespaceByID(id int64) (namespace Namespace, err error) {
return namespace, err
}
exists, err := x.Get(&namespace)
if err != nil {
return namespace, err
}
exists, err := x.Get(&namespace)
if err != nil {
return namespace, err
}
if !exists {
return namespace, ErrNamespaceDoesNotExist{ID: id}
}
if !exists {
return namespace, ErrNamespaceDoesNotExist{ID: id}
}
// Get the namespace Owner
namespace.Owner, err = GetUserByID(namespace.OwnerID)