mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 18:29:23 +00:00
optimization translation
This commit is contained in:
@@ -121,7 +121,7 @@ class FileTagsView(APIView):
|
||||
name_list = [name.strip() for name in names.split(",")]
|
||||
for name in name_list:
|
||||
if not check_tagname(name):
|
||||
error_msg = _(u'Tag can only contain letters, numbers, dot, hyphen or underscore')
|
||||
error_msg = _(u'Tag can only contain letters, numbers, dot, hyphen or underscore.')
|
||||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
||||
|
||||
FileTag.objects.delete_all_filetag_by_path(repo_id, parent_path,
|
||||
@@ -145,7 +145,7 @@ class FileTagsView(APIView):
|
||||
name_list = [name.strip() for name in names.split(",")]
|
||||
for name in name_list:
|
||||
if not check_tagname(name):
|
||||
error_msg = _(u'Tag can only contain letters, numbers, dot, hyphen or underscore')
|
||||
error_msg = _(u'Tag can only contain letters, numbers, dot, hyphen or underscore.')
|
||||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
||||
|
||||
res_tag_list = []
|
||||
@@ -165,7 +165,7 @@ class FileTagView(APIView):
|
||||
@check_parameter
|
||||
def delete(self, request, repo_id, parent_path, filename, name, is_dir):
|
||||
if not name or not check_tagname(name):
|
||||
error_msg = _(u'Tag can only contain letters, numbers, dot, hyphen or underscore')
|
||||
error_msg = _(u'Tag can only contain letters, numbers, dot, hyphen or underscore.')
|
||||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
||||
if FileTag.objects.delete_file_tag_by_path(repo_id,
|
||||
parent_path,filename,is_dir,name):
|
||||
|
@@ -12,7 +12,7 @@ from django.utils.translation import ugettext as _
|
||||
from seahub.api2.throttling import UserRateThrottle
|
||||
from seahub.api2.authentication import TokenAuthentication
|
||||
from seahub.api2.utils import api_error
|
||||
from seahub.revision_tag.models import Tags, RevisionTags
|
||||
from seahub.revision_tag.models import RevisionTags
|
||||
from seahub.views import check_folder_permission
|
||||
|
||||
import seaserv
|
||||
@@ -52,7 +52,7 @@ def check_parameter(func):
|
||||
names = [name.strip() for name in tag_names.split(',')]
|
||||
for name in names:
|
||||
if not check_tagname(name):
|
||||
error_msg = _("Tag can only contains letters, numbers, dot, hyphen or underscore")
|
||||
error_msg = _("Tag can only contain letters, numbers, dot, hyphen or underscore.")
|
||||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
||||
|
||||
if check_folder_permission(request, repo_id, '/') != 'rw':
|
||||
|
Reference in New Issue
Block a user