Changeset - 03028bf372d7
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-03-27 19:38:05
marcin@python-works.com
missing changesets should return 404 not redirect + flash.
It feels more correct.
2 files changed with 12 insertions and 12 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/changeset.py
Show inline comments
 
@@ -17,25 +17,25 @@
 
# (at your option) any later version.
 
#
 
# This program is distributed in the hope that it will be useful,
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
# GNU General Public License for more details.
 
#
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
import logging
 
import traceback
 
from collections import defaultdict
 
from webob.exc import HTTPForbidden, HTTPBadRequest
 
from webob.exc import HTTPForbidden, HTTPBadRequest, HTTPNotFound
 

	
 
from pylons import tmpl_context as c, url, request, response
 
from pylons.i18n.translation import _
 
from pylons.controllers.util import redirect
 
from rhodecode.lib.utils import jsonify
 

	
 
from rhodecode.lib.vcs.exceptions import RepositoryError, \
 
    ChangesetDoesNotExistError
 

	
 
import rhodecode.lib.helpers as h
 
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
 
from rhodecode.lib.base import BaseRepoController, render
 
@@ -195,25 +195,25 @@ class ChangesetController(BaseRepoContro
 
                rev_ranges = c.rhodecode_repo.get_changesets(start=rev_start,
 
                                                             end=rev_end)
 
            else:
 
                rev_ranges = [c.rhodecode_repo.get_changeset(revision)]
 

	
 
            c.cs_ranges = list(rev_ranges)
 
            if not c.cs_ranges:
 
                raise RepositoryError('Changeset range returned empty result')
 

	
 
        except (RepositoryError, ChangesetDoesNotExistError, Exception), e:
 
            log.error(traceback.format_exc())
 
            h.flash(str(e), category='error')
 
            return redirect(url('changeset_home', repo_name=c.repo_name))
 
            raise HTTPNotFound()
 

	
 
        c.changes = OrderedDict()
 

	
 
        c.lines_added = 0  # count of lines added
 
        c.lines_deleted = 0  # count of lines removes
 

	
 
        c.changeset_statuses = ChangesetStatus.STATUSES
 
        c.comments = []
 
        c.statuses = []
 
        c.inline_comments = []
 
        c.inline_cnt = 0
 

	
rhodecode/templates/errors/error_document.html
Show inline comments
 
@@ -24,34 +24,34 @@
 
           font-size: 1.6em;
 
         }
 
         .error_message{
 
            text-align: center;
 
            color:#003367;
 
            font-size: 1.6em;
 
            margin:10px;
 
         }
 
        </style>
 

	
 
    </head>
 
    <body>
 
	    <div class="flash_msg">
 
	        <% messages = h.flash.pop_messages() %>
 
	        % if messages:
 
	        <ul id="flash-messages">
 
	            % for message in messages:
 
	            <li class="${message.category}_msg">${message}</li>
 
	            % endfor
 
	        </ul>
 
	        % endif
 
	    </div>
 
        <div class="flash_msg">
 
            <% messages = h.flash.pop_messages() %>
 
            % if messages:
 
            <ul id="flash-messages">
 
                % for message in messages:
 
                <li class="${message.category}_msg">${message}</li>
 
                % endfor
 
            </ul>
 
            % endif
 
        </div>
 
        <div id="login">
 
            <div class="table">
 
                <div id="main_div">
 
                    <div style="font-size:2.0em;margin: 10px">${c.rhodecode_name}</div>
 
                    <h1 class="error_message">${c.error_message}</h1>
 

	
 
                    <p>${c.error_explanation}</p>
 

	
 
                    %if c.redirect_time:
 
                        <p>${_('You will be redirected to %s in %s seconds') % (c.redirect_module,c.redirect_time)}</p>
 
                    %endif
 

	
0 comments (0 inline, 0 general)