Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
289c474d
Commit
289c474d
authored
Oct 13, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coding style fixes
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
046b9e4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
weblate/trans/tests/test_reports.py
weblate/trans/tests/test_reports.py
+8
-8
weblate/trans/views/reports.py
weblate/trans/views/reports.py
+4
-4
No files found.
weblate/trans/tests/test_reports.py
View file @
289c474d
...
...
@@ -34,31 +34,31 @@ class ReportsTest(ViewTestCase):
self
.
user
.
save
()
def
add_change
(
self
):
response
=
self
.
edit_unit
(
self
.
edit_unit
(
'Hello, world!
\
n
'
,
'Nazdar svete!
\
n
'
)
def
test_credits_empty
(
self
):
credits
=
generate_credits
(
data
=
generate_credits
(
self
.
subproject
,
timezone
.
now
()
-
timedelta
(
days
=
1
)
)
self
.
assertEqual
(
credits
,
[])
self
.
assertEqual
(
data
,
[])
def
test_credits_one
(
self
):
self
.
add_change
()
credits
=
generate_credits
(
data
=
generate_credits
(
self
.
subproject
,
timezone
.
now
()
-
timedelta
(
days
=
1
)
)
self
.
assertEqual
(
credits
,
data
,
[{
'Czech'
:
[(
'noreply@weblate.org'
,
'Weblate Test'
)]}]
)
def
test_credits_more
(
self
):
response
=
self
.
edit_unit
(
self
.
edit_unit
(
'Hello, world!
\
n
'
,
'Nazdar svete2!
\
n
'
)
...
...
@@ -70,9 +70,9 @@ class ReportsTest(ViewTestCase):
reverse
(
'credits'
,
kwargs
=
self
.
kw_subproject
),
{
'style'
:
'json'
,
'start_date'
:
'2000-01-01'
},
)
credits
=
json
.
loads
(
response
.
content
)
data
=
json
.
loads
(
response
.
content
)
self
.
assertEqual
(
credits
,
data
,
[{
'Czech'
:
[[
'noreply@weblate.org'
,
'Weblate Test'
]]}]
)
...
...
weblate/trans/views/reports.py
View file @
289c474d
...
...
@@ -43,7 +43,7 @@ def generate_credits(component, start_date):
)
if
not
authors
:
continue
result
.
append
({
translation
.
language
.
name
:
sorted
(
set
(
authors
))})
result
.
append
({
translation
.
language
.
name
:
sorted
(
set
(
authors
))})
return
result
...
...
@@ -62,17 +62,17 @@ def get_credits(request, project, subproject):
if
not
form
.
is_valid
():
return
redirect
(
obj
)
credits
=
generate_credits
(
obj
,
form
.
cleaned_data
[
'start_date'
])
data
=
generate_credits
(
obj
,
form
.
cleaned_data
[
'start_date'
])
if
form
.
cleaned_data
[
'style'
]
==
'json'
:
return
HttpResponse
(
json
.
dumps
(
credits
),
json
.
dumps
(
data
),
content_type
=
'application/json'
)
result
=
[]
for
language
in
credits
:
for
language
in
data
:
name
,
translators
=
language
.
items
()[
0
]
result
.
append
(
u'* {0}
\
n
'
.
format
(
name
))
result
.
append
(
'
\
n
'
.
join
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment