Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Debian New Member Process
contributors.debian.org
Commits
b240804c
Commit
b240804c
authored
Sep 10, 2020
by
Subhadip Ghosh
Browse files
Fixes the import error for exported data
parent
254cd2f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
importer/importer.py
View file @
b240804c
...
...
@@ -3,6 +3,7 @@ from debiancontributors import parser
from
django.utils
import
timezone
from
django.conf
import
settings
import
django.http
from
requests.utils
import
requote_uri
from
.models
import
Submission
,
SubmissionLog
from
.batch
import
BatchImport
from
importer
import
serializers
...
...
@@ -178,6 +179,8 @@ class DataImporterV1:
models
.
Source
.
import_json
(
data
[
"sources"
])
log
.
info
(
f
"Imported
{
len
(
data
[
'sources'
])
}
sources"
)
self
.
encode_contribution_urls
(
data
[
"contributions"
])
sers
=
{
"users"
:
serializers
.
UserSerializer
,
"identifiers"
:
serializers
.
IdentifierSerializer
,
...
...
@@ -196,3 +199,8 @@ class DataImporterV1:
models
.
AggregatedPersonContribution
.
recompute
()
models
.
AggregatedSource
.
recompute
()
models
.
AggregatedPerson
.
recompute
()
def
encode_contribution_urls
(
self
,
contributions
):
for
cont
in
contributions
:
if
cont
[
"url"
]:
cont
[
"url"
]
=
requote_uri
(
cont
[
"url"
])
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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