models: use 'inbox-message' url endpoint in Document.url()

fixes #4249
This commit is contained in:
Benjamin Dauvergne 2014-01-23 16:43:29 +01:00
parent 1f07d22811
commit 558ca2b14a
5 changed files with 5 additions and 7 deletions

View File

@ -390,7 +390,7 @@ class Document(Model):
def url(self):
return urlparse.urljoin(app_settings.BASE_URL,
reverse('inbox', kwargs=dict(mailbox_id=self.id)))
reverse('inbox-message', kwargs=dict(mailbox_id=self.id)))
class DeletedMailbox(Model):

View File

@ -24,7 +24,6 @@ def get_sql_ids(sql, params):
def get_complex_join(qs, sql, params):
ids = list(get_sql_ids(sql, params))
print 'ids', ids
return qs.filter(pk__in=ids)
def get_unseen_documents_count(related_users, user):

View File

@ -5,7 +5,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{% trans "site_title" %} — {% block title %}{% endblock %}</title>
{% block jquery_script %}
<script src="{{ STATIC_URL }}jquery/js/jquery-1.6.2.min.js" type="text/javascript"></script>
<script>//<![CDATA[
if(!window.jQuery) document.write('<scr'+'ipt src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></scr'+'ipt>');
//]]></script>
{% endblock %}
{% block extra_scripts %}
{% endblock %}

View File

@ -188,6 +188,7 @@ def send_file(request, file_type_id):
recipients_count=recipients_count)
return redirect('outbox')
except Exception:
raise
import logging
logging.getLogger(__name__).exception('unable to create a new document')

View File

@ -265,7 +265,6 @@ else:
"email": "mail"
}
DEBUG_TOOLBAR_CONFIG = {}
try:
from local_settings import *
@ -293,10 +292,7 @@ if DEBUG and 'SECRET_KEY' not in globals():
if USE_DEBUG_TOOLBAR:
try:
import debug_toolbar
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
INSTALLED_APPS += ('debug_toolbar',)
if 'INTERCEPT_REDIRECTS' not in DEBUG_TOOLBAR_CONFIG:
DEBUG_TOOLBAR_CONFIG.update({ 'INTERCEPT_REDIRECTS': False })
except ImportError:
print "Debug toolbar missing, not loaded"