1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 14:21:23 +00:00

Remove root function to reduce redirects

This commit is contained in:
zhengxie
2014-09-24 10:53:37 +08:00
parent 24f1b7d696
commit ed810b6205
2 changed files with 1 additions and 7 deletions

View File

@@ -38,7 +38,7 @@ urlpatterns = patterns('',
(r'^accounts/', include('seahub.base.registration_urls')), (r'^accounts/', include('seahub.base.registration_urls')),
(r'^$', root), (r'^$', myhome),
#url(r'^home/$', direct_to_template, { 'template': 'home.html' } ), #url(r'^home/$', direct_to_template, { 'template': 'home.html' } ),
url(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')), url(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')),
url(r'^home/my/$', myhome, name='myhome'), url(r'^home/my/$', myhome, name='myhome'),

View File

@@ -68,12 +68,6 @@ from seahub.settings import FILE_PREVIEW_MAX_SIZE, INIT_PASSWD, USE_PDFJS, \
# Get an instance of a logger # Get an instance of a logger
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def root(request):
if request.user.is_authenticated():
return HttpResponseRedirect(reverse(myhome))
else:
return HttpResponseRedirect(settings.LOGIN_URL)
def validate_owner(request, repo_id): def validate_owner(request, repo_id):
""" """
Check whether user in the request owns the repo. Check whether user in the request owns the repo.