Fixing add new subscription action to use correct folders.

This commit is contained in:
Samuel Clay 2014-02-10 12:55:56 -08:00
parent 312a3fc8d5
commit 8aa50201eb
2 changed files with 6 additions and 2 deletions

View file

@ -310,7 +310,10 @@ def api_folder_list(request, trigger_slug=None):
user = request.user
usf = UserSubscriptionFolders.objects.get(user=user)
flat_folders = usf.flatten_folders()
titles = [dict(label="All Site Stories", value="all")]
if 'add-new-subscription' in request.path:
titles = []
else:
titles = [dict(label="All Site Stories", value="all")]
for folder_title in sorted(flat_folders.keys()):
if folder_title and folder_title != " ":

View file

@ -190,7 +190,8 @@ def add_object_to_folder(obj, in_folder, folders, parent='', added=False):
if isinstance(obj, dict):
obj_identifier = obj.keys()[0]
if (not in_folder and not parent and
if ((not in_folder or in_folder == " ") and
not parent and
not isinstance(obj, dict) and
obj_identifier not in folders):
folders.append(obj)