Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3575)

Issue 65070043: Update subscription API

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 2 months ago by ana.balica
Modified:
10 years, 1 month ago
Reviewers:
thomas.j.waldmann
Visibility:
Public.

Description

Use fqname(s) as parameters to methods `User.subscribe()`, `User.unsubscribe()`, `User.is_subscribed_to()`. Update methods, tests and method usages.

Patch Set 1 #

Total comments: 28

Patch Set 2 : Add/change comments #

Patch Set 3 : Extract meta keys directly in the `subscribe_item()` view #

Patch Set 4 : Update tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -86 lines) Patch
M MoinMoin/_tests/test_user.py View 1 2 3 2 chunks +19 lines, -15 lines 0 comments Download
M MoinMoin/apps/frontend/views.py View 1 2 5 chunks +5 lines, -14 lines 0 comments Download
M MoinMoin/items/__init__.py View 3 chunks +0 lines, -3 lines 0 comments Download
M MoinMoin/templates/itemviews.html View 1 chunk +1 line, -1 line 0 comments Download
M MoinMoin/themes/__init__.py View 1 chunk +1 line, -3 lines 0 comments Download
M MoinMoin/user.py View 1 5 chunks +50 lines, -50 lines 0 comments Download

Messages

Total messages: 4
Thomas.J.Waldmann
please check those unrelated(?) changes. https://codereview.appspot.com/65070043/diff/1/MoinMoin/_tests/test_user.py File MoinMoin/_tests/test_user.py (right): https://codereview.appspot.com/65070043/diff/1/MoinMoin/_tests/test_user.py#newcode142 MoinMoin/_tests/test_user.py:142: the_user.subscribe(CompositeName(u"", NAME, u"SomeOtherPageName")) btw, ...
10 years, 2 months ago (2014-02-20 14:35:08 UTC) #1
ana.balica
https://codereview.appspot.com/65070043/diff/1/MoinMoin/_tests/test_user.py File MoinMoin/_tests/test_user.py (right): https://codereview.appspot.com/65070043/diff/1/MoinMoin/_tests/test_user.py#newcode158 MoinMoin/_tests/test_user.py:158: assert not the_user.is_subscribed_to([fqname]) On 2014/02/20 14:35:09, Thomas.J.Waldmann wrote: > ...
10 years, 2 months ago (2014-02-23 19:23:59 UTC) #2
ana.balica
https://codereview.appspot.com/65070043/diff/1/MoinMoin/_tests/test_user.py File MoinMoin/_tests/test_user.py (right): https://codereview.appspot.com/65070043/diff/1/MoinMoin/_tests/test_user.py#newcode149 MoinMoin/_tests/test_user.py:149: (meta[NAMESPACE], NAME, pagename), On 2014/02/20 14:35:09, Thomas.J.Waldmann wrote: > ...
10 years, 1 month ago (2014-03-06 16:40:17 UTC) #3
Thomas.J.Waldmann
10 years, 1 month ago (2014-03-06 16:53:13 UTC) #4
https://codereview.appspot.com/65070043/diff/1/MoinMoin/_tests/test_user.py
File MoinMoin/_tests/test_user.py (right):

https://codereview.appspot.com/65070043/diff/1/MoinMoin/_tests/test_user.py#n...
MoinMoin/_tests/test_user.py:149: (meta[NAMESPACE], NAME, pagename),
the reason why we have 2 fields (NAME and NAME_EXACT) for the item name(s) is
that one can search for some pieces of the name (via NAME) and also for the
exact full name (via NAME_EXACT).

Thus, the best way to test, is to give a full exact name to test against
NAME_EXACT and only give a part of the name to test against NAME.

https://codereview.appspot.com/65070043/diff/1/MoinMoin/_tests/test_user.py#n...
MoinMoin/_tests/test_user.py:158: assert not the_user.is_subscribed_to([fqname])
for checking is_subscribed_to, you need to have an item.
to have an item, you need either to already have the item instance or a unique
identifier to fetch it yourself from storage.

for subscribing, the requirement is to get any supported / valid subscription
pattern, which differs in types from any supported / valid fqname.

https://codereview.appspot.com/65070043/diff/1/MoinMoin/apps/frontend/views.py
File MoinMoin/apps/frontend/views.py (left):

https://codereview.appspot.com/65070043/diff/1/MoinMoin/apps/frontend/views.p...
MoinMoin/apps/frontend/views.py:987: abort(403)
> Method `is_subscribed_to()` was the only method that required an item object.

ok, if that is the only reason why it is passed to the template, this change is
a good cleanup.

> The problem is that item object might have been
> used for other purposes in the
> template, but I don't know how to identify it.
> I did manual testing, but I am
> sure it can't cover everything.

well, you see whether "item" is used in the template html.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b