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
c3dc08f5
Verified
Commit
c3dc08f5
authored
Aug 01, 2022
by
Mattia Rizzolo
Browse files
first batch of changes to support django 4
Signed-off-by:
Mattia Rizzolo
<
mattia@debian.org
>
parent
da0d751a
Pipeline
#406496
failed with stage
in 2 minutes and 14 seconds
Changes
14
Pipelines
1
Show whitespace changes
Inline
Side-by-side
claim/forms.py
View file @
c3dc08f5
from
__future__
import
annotations
from
__future__
import
annotations
from
django.utils.translation
import
u
gettext_lazy
as
_
from
django.utils.translation
import
gettext_lazy
as
_
from
django
import
forms
from
django
import
forms
from
dc.lib.forms
import
BootstrapAttrsMixin
from
dc.lib.forms
import
BootstrapAttrsMixin
import
contributors.models
as
cmodels
import
contributors.models
as
cmodels
...
...
contributor/views.py
View file @
c3dc08f5
...
@@ -2,7 +2,7 @@ from django import http
...
@@ -2,7 +2,7 @@ from django import http
from
django.shortcuts
import
redirect
,
get_object_or_404
from
django.shortcuts
import
redirect
,
get_object_or_404
from
django.views.generic
import
DetailView
,
View
from
django.views.generic
import
DetailView
,
View
from
contributors
import
models
as
cmodels
from
contributors
import
models
as
cmodels
from
django.utils.translation
import
u
gettext
as
_
from
django.utils.translation
import
gettext
as
_
from
dc.mixins
import
VisitorMixin
from
dc.mixins
import
VisitorMixin
from
signon.models
import
Identity
from
signon.models
import
Identity
...
...
contributors/models.py
View file @
c3dc08f5
from
django.utils.translation
import
u
gettext_lazy
as
_
from
django.utils.translation
import
gettext_lazy
as
_
from
django.conf
import
settings
from
django.conf
import
settings
from
django.db
import
models
,
transaction
from
django.db
import
models
,
transaction
from
django.contrib.auth.models
import
BaseUserManager
,
PermissionsMixin
from
django.contrib.auth.models
import
BaseUserManager
,
PermissionsMixin
...
...
contributors/urls.py
View file @
c3dc08f5
from
__future__
import
annotations
from
__future__
import
annotations
from
django.urls
import
path
from
django.urls
import
path
from
django.conf.urls
import
url
from
importer
import
views
as
iviews
from
importer
import
views
as
iviews
from
.
import
views
from
.
import
views
urlpatterns
=
[
urlpatterns
=
[
url
(
r
'^year/(?P<year>\d+)$
'
,
views
.
Contributors
.
as_view
(),
name
=
"contributors_year"
),
path
(
'year/<int:year>)
'
,
views
.
Contributors
.
as_view
(),
name
=
"contributors_year"
),
url
(
r
'^
post
$
'
,
iviews
.
PostSourceView
.
as_view
(),
name
=
"contributors_post"
),
path
(
'
post'
,
iviews
.
PostSourceView
.
as_view
(),
name
=
"contributors_post"
),
url
(
r
'^
test_post
$
'
,
iviews
.
TestPostSourceView
.
as_view
(),
name
=
"contributors_test_post"
),
path
(
'
test_post'
,
iviews
.
TestPostSourceView
.
as_view
(),
name
=
"contributors_test_post"
),
url
(
r
'^
flat
$
'
,
views
.
ContributorsFlat
.
as_view
(),
name
=
"contributors_flat"
),
path
(
'
flat'
,
views
.
ContributorsFlat
.
as_view
(),
name
=
"contributors_flat"
),
url
(
r
'^
new
$
'
,
views
.
ContributorsNew
.
as_view
(),
name
=
"contributors_new"
),
path
(
'
new'
,
views
.
ContributorsNew
.
as_view
(),
name
=
"contributors_new"
),
url
(
r
'^
mia
$
'
,
views
.
ContributorsMIA
.
as_view
(),
name
=
"contributors_mia"
),
path
(
'
mia'
,
views
.
ContributorsMIA
.
as_view
(),
name
=
"contributors_mia"
),
url
(
r
'^
mia/query
$
'
,
views
.
MIAQuery
.
as_view
(),
name
=
"contributors_mia_query"
),
path
(
'
mia/query'
,
views
.
MIAQuery
.
as_view
(),
name
=
"contributors_mia_query"
),
url
(
r
'^
sources/flat
$
'
,
views
.
SourcesFlat
.
as_view
(),
name
=
"contributors_sources_flat"
),
path
(
'
sources/flat'
,
views
.
SourcesFlat
.
as_view
(),
name
=
"contributors_sources_flat"
),
url
(
r
'^
export/sources
$
'
,
iviews
.
ExportSources
.
as_view
(),
name
=
"contributors_export_sources"
),
path
(
'
export/sources'
,
iviews
.
ExportSources
.
as_view
(),
name
=
"contributors_export_sources"
),
url
(
r
'^
site_status
$
'
,
views
.
SiteStatus
.
as_view
(),
name
=
"site_status"
),
path
(
'
site_status'
,
views
.
SiteStatus
.
as_view
(),
name
=
"site_status"
),
url
(
r
'^
test_messages
$
'
,
views
.
TestMessages
.
as_view
(),
name
=
"test_messages"
),
path
(
'
test_messages'
,
views
.
TestMessages
.
as_view
(),
name
=
"test_messages"
),
url
(
r
'^
export/public
$
'
,
iviews
.
ExportDB
.
as_view
(),
name
=
"contributors_export_public"
),
path
(
'
export/public'
,
iviews
.
ExportDB
.
as_view
(),
name
=
"contributors_export_public"
),
]
]
contributors/views.py
View file @
c3dc08f5
...
@@ -137,7 +137,7 @@ class ContributorsMIA(VisitorMixin, TemplateView):
...
@@ -137,7 +137,7 @@ class ContributorsMIA(VisitorMixin, TemplateView):
.
select_related
(
"user"
)
.
select_related
(
"user"
)
if
people
is
not
None
:
if
people
is
not
None
:
res
[
"people"
]
=
[
p
for
p
in
res
[
"people"
]
if
p
.
user
.
email
in
people
]
res
[
"people"
]
=
[
p
for
p
in
res
[
"people"
]
if
any
(
e
in
people
for
e
in
[
x
.
name
for
x
in
p
.
user
.
identifiers
.
filter
(
type
=
'email'
).
all
()])
]
return
res
return
res
...
...
deploy/urls.py
View file @
c3dc08f5
from
django.
conf.
urls
import
url
from
django.urls
import
path
from
.
import
views
from
.
import
views
urlpatterns
=
[
urlpatterns
=
[
url
(
r
'^
gitlab-pipeline-hook
$
'
,
views
.
GitlabPipeline
.
as_view
(),
name
=
"deploy_gitlab_pipeline_hook"
),
path
(
'
gitlab-pipeline-hook'
,
views
.
GitlabPipeline
.
as_view
(),
name
=
"deploy_gitlab_pipeline_hook"
),
]
]
impersonate/views.py
View file @
c3dc08f5
from
__future__
import
annotations
from
__future__
import
annotations
from
django.utils.translation
import
u
gettext
as
_
from
django.utils.translation
import
gettext
as
_
from
django.views.generic
import
View
from
django.views.generic
import
View
from
django.shortcuts
import
redirect
from
django.shortcuts
import
redirect
from
django.core.exceptions
import
PermissionDenied
from
django.core.exceptions
import
PermissionDenied
...
...
importer/urls.py
View file @
c3dc08f5
from
django.
conf.
urls
import
url
from
django.urls
import
path
from
.
import
views
from
.
import
views
urlpatterns
=
[
urlpatterns
=
[
url
(
r
'^
logs
$
'
,
views
.
Logs
.
as_view
(),
name
=
"importer_logs"
),
path
(
'
logs'
,
views
.
Logs
.
as_view
(),
name
=
"importer_logs"
),
url
(
r
'^
status
$
'
,
views
.
Status
.
as_view
(),
name
=
"importer_status"
),
path
(
'
status'
,
views
.
Status
.
as_view
(),
name
=
"importer_status"
),
url
(
r
'^status/(?P<sname>[^/]+)$
'
,
views
.
SourceStatus
.
as_view
(),
name
=
"importer_source_status"
),
path
(
'status/<str:sname>
'
,
views
.
SourceStatus
.
as_view
(),
name
=
"importer_source_status"
),
url
(
r
'^
submission/
(?P<pk>\d+)$
'
,
views
.
ShowSubmission
.
as_view
(),
name
=
"importer_submission"
),
path
(
'
submission/
<int:pk>
'
,
views
.
ShowSubmission
.
as_view
(),
name
=
"importer_submission"
),
]
]
importer/views.py
View file @
c3dc08f5
# from django.utils.translation import ugettext as _
from
django.utils.decorators
import
method_decorator
from
django.utils.decorators
import
method_decorator
from
django.views.decorators.csrf
import
csrf_exempt
from
django.views.decorators.csrf
import
csrf_exempt
from
django.views.generic
import
View
,
TemplateView
from
django.views.generic
import
View
,
TemplateView
...
...
mia/urls.py
View file @
c3dc08f5
from
django.
conf.
urls
import
url
from
django.urls
import
path
from
.
import
views
from
.
import
views
urlpatterns
=
[
urlpatterns
=
[
url
(
r
'^
last-significant.json
$
'
,
views
.
ByFingerprint
.
as_view
(),
name
=
"mia_last_significant"
),
path
(
'
last-significant.json'
,
views
.
ByFingerprint
.
as_view
(),
name
=
"mia_last_significant"
),
]
]
mia/views.py
View file @
c3dc08f5
from
django.utils.translation
import
u
gettext
as
_
from
django.utils.translation
import
gettext
as
_
from
django.views.generic
import
View
from
django.views.generic
import
View
from
django
import
http
from
django
import
http
from
dc.mixins
import
VisitorMixin
from
dc.mixins
import
VisitorMixin
...
...
signon/models.py
View file @
c3dc08f5
from
__future__
import
annotations
from
__future__
import
annotations
import
json
import
json
import
datetime
import
datetime
from
django.utils.translation
import
u
gettext_lazy
as
_
from
django.utils.translation
import
gettext_lazy
as
_
from
django.db
import
models
from
django.db
import
models
from
django.forms.models
import
model_to_dict
from
django.forms.models
import
model_to_dict
from
django.contrib.auth
import
get_user_model
from
django.contrib.auth
import
get_user_model
...
...
signon/providers.py
View file @
c3dc08f5
...
@@ -58,7 +58,7 @@ class BoundProvider:
...
@@ -58,7 +58,7 @@ class BoundProvider:
Return a dict describing actions for actions that can be taken for this
Return a dict describing actions for actions that can be taken for this
provider in the current request
provider in the current request
"""
"""
from
django.utils.translation
import
u
gettext
as
_
from
django.utils.translation
import
gettext
as
_
from
django.urls
import
reverse
from
django.urls
import
reverse
my_user
=
None
my_user
=
None
other_users
=
set
()
other_users
=
set
()
...
@@ -131,7 +131,7 @@ class Provider:
...
@@ -131,7 +131,7 @@ class Provider:
class
BoundBaseSessionProvider
(
BoundProvider
):
class
BoundBaseSessionProvider
(
BoundProvider
):
def
get_actions
(
self
):
def
get_actions
(
self
):
from
django.utils.translation
import
u
gettext
as
_
from
django.utils.translation
import
gettext
as
_
from
django.urls
import
reverse
from
django.urls
import
reverse
res
=
super
().
get_actions
()
res
=
super
().
get_actions
()
res
.
append
({
res
.
append
({
...
...
sources/views.py
View file @
c3dc08f5
from
django
import
http
from
django
import
http
from
django.shortcuts
import
redirect
,
get_object_or_404
from
django.shortcuts
import
redirect
,
get_object_or_404
# from django.utils.translation import ugettext as _
from
django.views.generic
import
DetailView
,
TemplateView
,
View
from
django.views.generic
import
DetailView
,
TemplateView
,
View
from
django.views.generic.edit
import
CreateView
,
UpdateView
,
DeleteView
from
django.views.generic.edit
import
CreateView
,
UpdateView
,
DeleteView
from
django.urls
import
reverse
,
reverse_lazy
from
django.urls
import
reverse
,
reverse_lazy
...
...
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