mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 07:41:26 +00:00
[api2] Comment out regdevice
This commit is contained in:
@@ -12,7 +12,7 @@ urlpatterns = patterns('',
|
|||||||
url(r'^accounts/$', Accounts.as_view(), name="accounts"),
|
url(r'^accounts/$', Accounts.as_view(), name="accounts"),
|
||||||
url(r'^accounts/(?P<email>\S+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/$', Account.as_view(), name="api2-account"),
|
url(r'^accounts/(?P<email>\S+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/$', Account.as_view(), name="api2-account"),
|
||||||
url(r'^account/info/$', AccountInfo.as_view()),
|
url(r'^account/info/$', AccountInfo.as_view()),
|
||||||
url(r'^regdevice/$', RegDevice.as_view(), name="regdevice"),
|
# url(r'^regdevice/$', RegDevice.as_view(), name="regdevice"),
|
||||||
url(r'^search/$', Search.as_view(), name='api_search'),
|
url(r'^search/$', Search.as_view(), name='api_search'),
|
||||||
url(r'^repos/$', Repos.as_view(), name="api2-repos"),
|
url(r'^repos/$', Repos.as_view(), name="api2-repos"),
|
||||||
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/$', Repo.as_view(), name="api2-repo"),
|
url(r'^repos/(?P<repo_id>[-0-9a-f]{36})/$', Repo.as_view(), name="api2-repo"),
|
||||||
|
@@ -23,7 +23,6 @@ from django.http import HttpResponse, Http404
|
|||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
from django.utils.translation import ugettext as _
|
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
from models import Token
|
from models import Token
|
||||||
@@ -1662,7 +1661,7 @@ class DirSubRepoView(APIView):
|
|||||||
path = request.GET.get('p')
|
path = request.GET.get('p')
|
||||||
name = request.GET.get('name')
|
name = request.GET.get('name')
|
||||||
if not (path and name):
|
if not (path and name):
|
||||||
result['error'] = _('Argument missing')
|
result['error'] = 'Argument missing'
|
||||||
return HttpResponse(json.dumps(result), status=400, content_type=content_type)
|
return HttpResponse(json.dumps(result), status=400, content_type=content_type)
|
||||||
|
|
||||||
username = request.user.username
|
username = request.user.username
|
||||||
@@ -2154,7 +2153,7 @@ def get_group_msgs(groupid, page, username):
|
|||||||
if att.filetype == IMAGE:
|
if att.filetype == IMAGE:
|
||||||
att.obj_id = get_file_id_by_path(att.repo_id, path)
|
att.obj_id = get_file_id_by_path(att.repo_id, path)
|
||||||
if not att.obj_id:
|
if not att.obj_id:
|
||||||
att.err = _(u'File does not exist')
|
att.err = 'File does not exist'
|
||||||
else:
|
else:
|
||||||
att.token = seafile_api.get_httpserver_access_token(
|
att.token = seafile_api.get_httpserver_access_token(
|
||||||
att.repo_id, att.obj_id, 'view', username)
|
att.repo_id, att.obj_id, 'view', username)
|
||||||
@@ -2199,7 +2198,7 @@ def discussion(request, msg_id):
|
|||||||
if repo:
|
if repo:
|
||||||
att.name = repo.name
|
att.name = repo.name
|
||||||
else:
|
else:
|
||||||
att.err = _(u'the libray does not exist')
|
att.err = 'the libray does not exist'
|
||||||
else:
|
else:
|
||||||
path = path.rstrip('/') # cut out last '/' if possible
|
path = path.rstrip('/') # cut out last '/' if possible
|
||||||
att.name = os.path.basename(path)
|
att.name = os.path.basename(path)
|
||||||
@@ -2210,7 +2209,7 @@ def discussion(request, msg_id):
|
|||||||
if att.filetype == IMAGE:
|
if att.filetype == IMAGE:
|
||||||
att.obj_id = get_file_id_by_path(att.repo_id, path)
|
att.obj_id = get_file_id_by_path(att.repo_id, path)
|
||||||
if not att.obj_id:
|
if not att.obj_id:
|
||||||
att.err = _(u'File does not exist')
|
att.err = 'File does not exist'
|
||||||
else:
|
else:
|
||||||
att.token = seafile_api.get_httpserver_access_token(
|
att.token = seafile_api.get_httpserver_access_token(
|
||||||
att.repo_id, att.obj_id, 'view', request.user.username)
|
att.repo_id, att.obj_id, 'view', request.user.username)
|
||||||
@@ -2261,18 +2260,18 @@ def repo_history_changes(request, repo_id):
|
|||||||
content_type = 'application/json; charset=utf-8'
|
content_type = 'application/json; charset=utf-8'
|
||||||
|
|
||||||
if not access_to_repo(request, repo_id, ''):
|
if not access_to_repo(request, repo_id, ''):
|
||||||
return HttpResponse(json.dumps({"err": _(u'Permission denied')}), status=400, content_type=content_type)
|
return HttpResponse(json.dumps({"err": 'Permission denied'}), status=400, content_type=content_type)
|
||||||
|
|
||||||
repo = get_repo(repo_id)
|
repo = get_repo(repo_id)
|
||||||
if not repo:
|
if not repo:
|
||||||
return HttpResponse(json.dumps({"err": _(u'Library does not exist')}), status=400, content_type=content_type)
|
return HttpResponse(json.dumps({"err": 'Library does not exist'}), status=400, content_type=content_type)
|
||||||
|
|
||||||
if repo.encrypted and not is_passwd_set(repo_id, request.user.username):
|
if repo.encrypted and not is_passwd_set(repo_id, request.user.username):
|
||||||
return HttpResponse(json.dumps({"err": _(u'Library is encrypted')}), status=400, content_type=content_type)
|
return HttpResponse(json.dumps({"err": 'Library is encrypted'}), status=400, content_type=content_type)
|
||||||
|
|
||||||
commit_id = request.GET.get('commit_id', '')
|
commit_id = request.GET.get('commit_id', '')
|
||||||
if not commit_id:
|
if not commit_id:
|
||||||
return HttpResponse(json.dumps({"err": _(u'Invalid argument')}), status=400, content_type=content_type)
|
return HttpResponse(json.dumps({"err": 'Invalid argument'}), status=400, content_type=content_type)
|
||||||
|
|
||||||
changes = get_diff(repo_id, '', commit_id)
|
changes = get_diff(repo_id, '', commit_id)
|
||||||
|
|
||||||
@@ -2283,10 +2282,10 @@ def repo_history_changes(request, repo_id):
|
|||||||
elif c.second_parent_id is None:
|
elif c.second_parent_id is None:
|
||||||
# Normal commit only has one parent.
|
# Normal commit only has one parent.
|
||||||
if c.desc.startswith('Changed library'):
|
if c.desc.startswith('Changed library'):
|
||||||
changes['cmt_desc'] = _('Changed library name or description')
|
changes['cmt_desc'] = 'Changed library name or description'
|
||||||
else:
|
else:
|
||||||
# A commit is a merge only if it has two parents.
|
# A commit is a merge only if it has two parents.
|
||||||
changes['cmt_desc'] = _('No conflict in the merge.')
|
changes['cmt_desc'] = 'No conflict in the merge.'
|
||||||
for k in changes:
|
for k in changes:
|
||||||
changes[k] = [f.replace ('a href="/', 'a class="normal" href="api://') for f in changes[k] ]
|
changes[k] = [f.replace ('a href="/', 'a class="normal" href="api://') for f in changes[k] ]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user