You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by Apache Bloodhound <de...@bloodhound.apache.org> on 2013/06/18 11:03:55 UTC
[Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
#561: Display more user-friendly error page when navigating to a non-existing
product
--------------------------+---------------
Reporter: rjollos | Owner:
Type: enhancement | Status: new
Priority: major | Version:
Resolution: |
--------------------------+---------------
After #529, an HTTPInternalError is displayed when navigating to a non-
existing product. For example, when entering the URL `/products/unknown`,
when `unknown` is a product that does not exist, the following is
displayed in the browser window with a white background:
{{{
Error
TracError: LookupError: Missing product unknown
}}}
Better behavior would be if Bloodhound didn't "go away" under this
scenario. In a discussion on the
[http://markmail.org/message/pk2a5jxflywelmuo mailing list], Olemis
suggested to //redirect to global products page and display a custom
message «Product %s not found».//
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Comment (by olemis):
Replying to [comment:9 rjollos]:
> Replying to [comment:8 olemis]:
> > Ok, I'll take a look . Notice that patches for both #561 and #541 are
needed .
>
> In #541 you've stated that the patch for that ticket is built on the
patch in #561, but you submitted the patch for this ticket before #541 and
comment:4 doesn't indicate that the patch in #541 is required.
Sorry the confusion is caused by the fact that my previous comment is
wrong . It should have been ''Notice that patches for both #561 and #541
are **related**.'' I apologize for all the trouble caused by my previous
statement.
That was just a comment . After applying this patch please do notice that
on default product misconfiguration (i.e. the subject of #541) the request
will be handled by the global environment directly . The few issues caused
by this will be fixed by the patch(es) submitted for #541 .
I'll provide an updated version for both patches asap .
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:11>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
--------------------------+-----------------------
Reporter: rjollos | Owner: nobody
Type: enhancement | Status: new
Priority: major | Milestone: Release 7
Component: dashboard | Version:
Resolution: | Keywords:
--------------------------+-----------------------
Changes (by rjollos):
* owner: => nobody
* component: => dashboard
* milestone: => Release 7
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:1>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: closed
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: fixed | Keywords: hooks
---------------------------+-----------------------
Comment (by olemis):
Replying to [comment:19 rjollos]:
> Please review, as I'm not overly confident with the changes. More
changes are needed to resolve the //RequestDone// error.
>
> ----
>
> (In [1502769])
>
> Modify test case now that //Product List// page is displayed when
navigating to a non-existing product after [1495037]. Refs #561.
AFAICT it's looking good . Handling of `RequestDone` is an implementation
detail we'll have to live with (afaict)
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:20>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: nobody
Type: enhancement | Status: new
Priority: major | Milestone: Release 7
Component: multiproduct | Version:
Resolution: | Keywords:
---------------------------+-----------------------
Changes (by rjollos):
* component: dashboard => multiproduct
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:2>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: closed
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: fixed | Keywords: hooks
---------------------------+-----------------------
Comment (by rjollos):
Please review, as I'm not overly confident with the changes. More changes
are needed to resolve the //RequestDone// error.
----
(In [1502769])
Modify test case now that //Product List// page is displayed when
navigating to a non-existing product after [1495037]. Refs #561.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:19>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Comment (by olemis):
Replying to [comment:13 olemis]:
> Replying to [comment:12 rjollos]:
[...]
> > I generated a revised patch for this ticket last evening that fixes
the two issues noted in comment:7, but I had to make so many changes to
the code in `process_request` that I wasn't confident enough to commit it
without further testing. I could post that patch soon though, if you were
willing to give it a review and further testing.
[...]
Of course , if you share it I'll take a look ;)
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:14>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Comment (by olemis):
Replying to [comment:7 rjollos]:
> There are a few issues with the patch:
> * Warning message is displayed when `href` is `/products` or
`/products/`.
> * `/products`: Warning Product None not found
> * `/products/`: Warning Product not found
> * The //Create products// button no longer works.
>
> Since I committed some of the cleanup/refactoring changes already, I've
attached a revised version of the patch:
[attachment:t561_r1493739_hooks_no_product-1.diff]
>
Ok, I'll take a look . Notice that patches for both #561 and #541 are
needed .
> Unrelated to your patch, at the end of `process_request`,
`product_view.html` is returned.
> However I can't find a way to cause the product view page to be
displayed.
Two options
1. /products/x/products/x
2. set dashboard as default handler for product home page by using
TracIni options
> I would have guessed that the products listed on the `product_list` page
(`/products`) would link to the `product_view` page, but the links seem to
direct to the default handler for the product.
AFAICT, that's expected behavior if using the default bootstrap handlers
together with environment / request factories distributed with Bloodhound
. May be different in other deployments by implementing custom bootstrap
handlers .
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:8>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Ryan Ollos <ry...@wandisco.com>.
On Thu, Jun 20, 2013 at 8:26 AM, Olemis Lang <ol...@gmail.com> wrote:
> > but from what I can
> > see:
> >
> > * The permissions check:
> > {{{#!python
> > if pid:
> > req.perm('product', pid).require('PRODUCT_VIEW')
> > }}}
> > doesn't seem to have any effect after
>
> Authz permissions , though more testing is needed , yes ...
Oh, right. I completely failed to consider authz permissions at product
scope.
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Olemis Lang <ol...@gmail.com>.
On 6/20/13, Apache Bloodhound <de...@bloodhound.apache.org> wrote:
> #561: Display more user-friendly error page when navigating to a
> non-existing
> product
> ---------------------------+-----------------------
> Reporter: rjollos | Owner: rjollos
> Type: enhancement | Status: closed
> Priority: major | Milestone: Release 6
> Component: multiproduct | Version:
> Resolution: fixed | Keywords: hooks
> ---------------------------+-----------------------
> Changes (by rjollos):
>
> * status: review => closed
> * resolution: => fixed
>
>
> Comment:
>
> (In [1495037])
>
> Fixes #561: Display a warning and the products list when accessing a non-
> existent product. Patch from Olemis, with minor modifications.
>
> ----
>
[...]
>
> I'll just conclude by saying, more testing is needed,
see #567
> but from what I can
> see:
>
> * The permissions check:
> {{{#!python
> if pid:
> req.perm('product', pid).require('PRODUCT_VIEW')
> }}}
> doesn't seem to have any effect after
Authz permissions , though more testing is needed , yes ...
> `req.perm.require('PRODUCT_VIEW')`, as far as I could see (but I left it
> in place for now).
;)
> * My previous statement seems to hold about
> `/products/prod1/products/prod2` displaying an empty dashboard when the
> user has permission to access `prod1` and regardless of whether they have
> permission to access `prod2`, and may be something we want to avoid.
yes that's true . The fact is that DB translators silently limit the
scope scope of SQL queries to product='active_prefix' . IMO we should
provide the means to display dashboards for prod2 in prod1 context (<=
i.e. fix it rather than remove it ... especially thinking of global
scope ;)
> * Really what we need are some functional tests here, so the code can be
> properly refactored!
>
see #567 .
--
Regards,
Olemis.
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: closed
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: fixed | Keywords: hooks
---------------------------+-----------------------
Changes (by rjollos):
* status: review => closed
* resolution: => fixed
Comment:
(In [1495037])
Fixes #561: Display a warning and the products list when accessing a non-
existent product. Patch from Olemis, with minor modifications.
----
This ticket significantly improves behavior when navigating to a non-
existing product, thanks Olemis! I did a bit of refactoring in
`process_request`, so please let me know if you spot any issues.
I'll just conclude by saying, more testing is needed, but from what I can
see:
* The permissions check:
{{{#!python
if pid:
req.perm('product', pid).require('PRODUCT_VIEW')
}}}
doesn't seem to have any effect after
`req.perm.require('PRODUCT_VIEW')`, as far as I could see (but I left it
in place for now).
* My previous statement seems to hold about
`/products/prod1/products/prod2` displaying an empty dashboard when the
user has permission to access `prod1` and regardless of whether they have
permission to access `prod2`, and may be something we want to avoid.
* Really what we need are some functional tests here, so the code can be
properly refactored!
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:17>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: closed
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: fixed | Keywords: hooks
---------------------------+-----------------------
Comment (by rjollos):
(In [1503569])
Fixed unit test failure after [1495037]. Refs #561.
Check for existence of warning message and combined two test cases that
were both testing the behavior when a product doesn't exist.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:21>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Comment (by rjollos):
There are a few issues with the patch:
* Warning message is displayed when `href` is `/products` or
`/products/`.
* `/products`: Warning Product None not found
* `/products/`: Warning Product not found
* The //Create products// button no longer works.
Since I committed some of the cleanup/refactoring changes already, I've
attached a revised version of the patch:
[attachment:t561_r1493739_hooks_no_product-1.diff]
Unrelated to your patch, at the end of `process_request`,
`product_view.html` is returned. However I can't find a way to cause the
product view page to be displayed. I would have guessed that the products
listed on the `product_list` page (`/products`) would link to the
`product_view` page, but the links seem to direct to the default handler
for the product.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:7>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Comment (by olemis):
Replying to [comment:8 olemis]:
> Replying to [comment:7 rjollos]:
>
> > I would have guessed that the products listed on the `product_list`
page (`/products`) would link to the `product_view` page, but the links
seem to direct to the default handler for the product.
>
> AFAICT, that's expected behavior if using the default bootstrap handlers
together with environment / request factories distributed with Bloodhound
. May be different in other deployments by implementing custom bootstrap
handlers .
For instance see links below (site powered by custom bootstrap handlers)
for one such deployment in which your assumptions are valid .
http://blood-hound.net/products/dataviz
http://dataviz.blood-hound.net/
http://dataviz.blood-hound.net/products/dataviz
http://dataviz.blood-hound.net/dashboard
it's work in progress though ;)
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:10>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: olemis
Type: enhancement | Status: accepted
Priority: major | Milestone: Release 7
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Changes (by olemis):
* keywords: => hooks
* owner: nobody => olemis
* status: new => accepted
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:3>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Comment (by rjollos):
Replying to [comment:8 olemis]:
> Ok, I'll take a look . Notice that patches for both #561 and #541 are
needed .
In #541 you've stated that the patch for that ticket is built on the patch
in #561, but you submitted the patch for this ticket before #541 and
comment:4 doesn't indicate that the patch in #541 is required.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:9>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Changes (by olemis):
* milestone: Release 7 => Release 6
Comment:
Rescheduling for [milestone:"Release 6"] because patches for #541 will
need this (see comment:3:ticket:541 )
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:6>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Comment (by rjollos):
Replying to [comment:8 olemis]:
> > However I can't find a way to cause the product view page to be
displayed.
>
> Two options
>
> 1. /products/x/products/x
> 2. set dashboard as default handler for product home page by using
TracIni options
Thanks, that clears up a lot. More questions on that later.
At the moment we have (with some intermediate lines omitted for brevity):
{{{#!python
req.perm.require('PRODUCT_VIEW')
pid = req.args.get('productid', None)
if pid:
req.perm('product', pid).require('PRODUCT_VIEW')
}}}
Per the testing I've done, this is equivalent to:
{{{#!python
pid = req.args.get('productid', None)
req.perm('product', pid).require('PRODUCT_VIEW')
}}}
Does that make sense?
I've also found a somewhat confusing scenario. Consider two products,
`prod1` and `prod2`. If a user has permission to access `prod1`, they can
view `/products/prod1/products/prod2` and what is displayed will be an
"empty" dashboard, regardless of whether they permission to access
`prod2`. Also, a user can see the list of all products by accessing
`/products/prod1/products/`.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:15>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 7
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Changes (by olemis):
* owner: olemis => rjollos
Comment:
I'm assigning this back to rjollos . Feel free to change owner.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:5>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: closed
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: fixed | Keywords: hooks
---------------------------+-----------------------
Comment (by rjollos):
[1495037] resulted in a change of one of the unit test failures (evaluated
in retrospect by running unit tests at r1495036 and r1495037):
r1495036:
{{{
Ran 1256 tests in 406.143s
FAILED (failures=4)
}}}
{{{
======================================================================
FAIL: test_product_pathinfo_warning (tests.web_ui.ProductModuleTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/user/Workspace/bh585/bloodhound/bloodhound_multiproduct/tests/web_ui.py",
line 167, in test_product_pathinfo_warning
test_cm.exception.detail)
AssertionError: 'Unable to render product page. Wrong setup ?' != u'Unable
to render product page. Wrong setup?'
}}}
----
r1495037:
{{{
Ran 1256 tests in 384.730s
FAILED (failures=4, errors=4)
}}}
{{{
======================================================================
FAIL: test_product_view (tests.web_ui.ProductModuleTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/user/Workspace/bh585/bloodhound/bloodhound_multiproduct/tests/web_ui.py",
line 244, in test_product_view
self._dispatch(req, self.global_env)
File
"/home/user/Workspace/bh585/bloodhound/bloodhound_multiproduct/tests/web_ui.py",
line 94, in _dispatch
return RequestDispatcher(env).dispatch(req)
File "/home/user/Workspace/bh585/bloodhound/trac/trac/web/main.py", line
224, in dispatch
self._post_process_request(req, *resp)
File "/home/user/Workspace/bh585/bloodhound/trac/trac/web/main.py", line
338, in _post_process_request
resp = f.post_process_request(req, *resp)
File
"/home/user/Workspace/bh585/bloodhound/bloodhound_multiproduct/tests/web_ui.py",
line 61, in post_process_request
self.testProcessing(req, template, data, content_type)
File
"/home/user/Workspace/bh585/bloodhound/bloodhound_multiproduct/tests/web_ui.py",
line 227, in assert_product_view
self.assertEquals('product_view.html', template)
AssertionError: 'product_view.html' != 'product_list.html'
}}}
The additional error is:
{{{
ERROR: test_product_pathinfo_warning (tests.web_ui.ProductModuleTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/home/user/Workspace/bh585/bloodhound/bloodhound_multiproduct/tests/web_ui.py",
line 164, in test_product_pathinfo_warning
self._dispatch(req, self.global_env)
File
"/home/user/Workspace/bh585/bloodhound/bloodhound_multiproduct/tests/web_ui.py",
line 94, in _dispatch
return RequestDispatcher(env).dispatch(req)
File "/home/user/Workspace/bh585/bloodhound/trac/trac/web/main.py", line
234, in dispatch
req.send(output, content_type or 'text/html')
File "/home/user/Workspace/bh585/bloodhound/trac/trac/web/api.py", line
499, in send
raise RequestDone
RequestDone
}}}
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:18>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Comment (by rjollos):
Replying to [comment:15 rjollos]:
> At the moment we have (with some intermediate lines omitted for
brevity):
> {{{#!python
> req.perm.require('PRODUCT_VIEW')
> pid = req.args.get('productid', None)
> if pid:
> req.perm('product', pid).require('PRODUCT_VIEW')
> }}}
>
> Per the testing I've done, this is equivalent to:
> {{{#!python
> pid = req.args.get('productid', None)
> req.perm('product', pid).require('PRODUCT_VIEW')
> }}}
>
> Does that make sense?
Further investigation reveals that `req.perm.require('PRODUCT_VIEW')` in
necessary to avoid the nonsensical message: ''PRODUCT_VIEW privileges are
required to perform this operation on Product None. You don't have the
required permissions.'' when accessing `/products` or
`/products/prod1/products`.
> Also, a user can see the list of all products by accessing
`/products/prod1/products/`.
Please ignore this part. My previous testing was flawed.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:16>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Comment (by rjollos):
No problem, I just wanted to make sure I wasn't missing something
important.
I generated a revised patch for this ticket last evening that fixes the
two issues noted in comment:7, but I had to make so many changes to the
code in `process_request` that I wasn't confident enough to commit it
without further testing. I could post that patch soon though, if you were
willing to give it a review and further testing. It seemed like
`process_request` could be refactored a bit to simplify the code.
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:12>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: rjollos
Type: enhancement | Status: review
Priority: major | Milestone: Release 6
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Comment (by olemis):
Replying to [comment:12 rjollos]:
> No problem, I just wanted to make sure I wasn't missing something
important.
>
;)
> I generated a revised patch for this ticket last evening that fixes the
two issues noted in comment:7, but I had to make so many changes to the
code in `process_request` that I wasn't confident enough to commit it
without further testing. I could post that patch soon though, if you were
willing to give it a review and further testing. It seemed like
`process_request` could be refactored a bit to simplify the code.
I'm sharing [attachment:t561_r1493739_hooks_no_product.2.diff this new
patch] . Feel free to chose between your own version and this one . Notice
that [comment:4:ticket:541 new patch] for #541 has been tested against
this one . Both issues are related .
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:13>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker
Re: [Apache Bloodhound] #561: Display more user-friendly error page
when navigating to a non-existing product
Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#561: Display more user-friendly error page when navigating to a non-existing
product
---------------------------+-----------------------
Reporter: rjollos | Owner: olemis
Type: enhancement | Status: review
Priority: major | Milestone: Release 7
Component: multiproduct | Version:
Resolution: | Keywords: hooks
---------------------------+-----------------------
Changes (by olemis):
* status: accepted => review
Comment:
[attachment:t561_r1493739_hooks_no_product.diff Attached patch] is aimed
at displaying product list and warning message for non-existing product
URLs . Details
{{{
#!sh
$ hg qapplied
t561/t561_r1493739_hooks_no_product.diff
$ hg log -r qparent --template="[{svnrev}] - {desc}\n"
[1493739] - Support for lowercase tokens in sql translator.
Refs: #548
}}}
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/561#comment:4>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker