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
Hide whitespace changes
Inline
Side-by-side
claim/forms.py
View file @
c3dc08f5
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
dc.lib.forms
import
BootstrapAttrsMixin
import
contributors.models
as
cmodels
...
...
contributor/views.py
View file @
c3dc08f5
...
...
@@ -2,7 +2,7 @@ from django import http
from
django.shortcuts
import
redirect
,
get_object_or_404
from
django.views.generic
import
DetailView
,
View
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
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.db
import
models
,
transaction
from
django.contrib.auth.models
import
BaseUserManager
,
PermissionsMixin
...
...
contributors/urls.py
View file @
c3dc08f5
from
__future__
import
annotations
from
django.urls
import
path
from
django.conf.urls
import
url
from
importer
import
views
as
iviews
from
.
import
views
urlpatterns
=
[
url
(
r
'^year/(?P<year>\d+)$
'
,
views
.
Contributors
.
as_view
(),
name
=
"contributors_year"
),
url
(
r
'^
post
$
'
,
iviews
.
PostSourceView
.
as_view
(),
name
=
"contributors_post"
),
url
(
r
'^
test_post
$
'
,
iviews
.
TestPostSourceView
.
as_view
(),
name
=
"contributors_test_post"
),
url
(
r
'^
flat
$
'
,
views
.
ContributorsFlat
.
as_view
(),
name
=
"contributors_flat"
),
url
(
r
'^
new
$
'
,
views
.
ContributorsNew
.
as_view
(),
name
=
"contributors_new"
),
url
(
r
'^
mia
$
'
,
views
.
ContributorsMIA
.
as_view
(),
name
=
"contributors_mia"
),
url
(
r
'^
mia/query
$
'
,
views
.
MIAQuery
.
as_view
(),
name
=
"contributors_mia_query"
),
url
(
r
'^
sources/flat
$
'
,
views
.
SourcesFlat
.
as_view
(),
name
=
"contributors_sources_flat"
),
url
(
r
'^
export/sources
$
'
,
iviews
.
ExportSources
.
as_view
(),
name
=
"contributors_export_sources"
),
url
(
r
'^
site_status
$
'
,
views
.
SiteStatus
.
as_view
(),
name
=
"site_status"
),
url
(
r
'^
test_messages
$
'
,
views
.
TestMessages
.
as_view
(),
name
=
"test_messages"
),
url
(
r
'^
export/public
$
'
,
iviews
.
ExportDB
.
as_view
(),
name
=
"contributors_export_public"
),
path
(
'year/<int:year>)
'
,
views
.
Contributors
.
as_view
(),
name
=
"contributors_year"
),
path
(
'
post'
,
iviews
.
PostSourceView
.
as_view
(),
name
=
"contributors_post"
),
path
(
'
test_post'
,
iviews
.
TestPostSourceView
.
as_view
(),
name
=
"contributors_test_post"
),
path
(
'
flat'
,
views
.
ContributorsFlat
.
as_view
(),
name
=
"contributors_flat"
),
path
(
'
new'
,
views
.
ContributorsNew
.
as_view
(),
name
=
"contributors_new"
),
path
(
'
mia'
,
views
.
ContributorsMIA
.
as_view
(),
name
=
"contributors_mia"
),
path
(
'
mia/query'
,
views
.
MIAQuery
.
as_view
(),
name
=
"contributors_mia_query"
),
path
(
'
sources/flat'
,
views
.
SourcesFlat
.
as_view
(),
name
=
"contributors_sources_flat"
),
path
(
'
export/sources'
,
iviews
.
ExportSources
.
as_view
(),
name
=
"contributors_export_sources"
),
path
(
'
site_status'
,
views
.
SiteStatus
.
as_view
(),
name
=
"site_status"
),
path
(
'
test_messages'
,
views
.
TestMessages
.
as_view
(),
name
=
"test_messages"
),
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):
.
select_related
(
"user"
)
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
...
...
deploy/urls.py
View file @
c3dc08f5
from
django.
conf.
urls
import
url
from
django.urls
import
path
from
.
import
views
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
django.utils.translation
import
u
gettext
as
_
from
django.utils.translation
import
gettext
as
_
from
django.views.generic
import
View
from
django.shortcuts
import
redirect
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
urlpatterns
=
[
url
(
r
'^
logs
$
'
,
views
.
Logs
.
as_view
(),
name
=
"importer_logs"
),
url
(
r
'^
status
$
'
,
views
.
Status
.
as_view
(),
name
=
"importer_status"
),
url
(
r
'^status/(?P<sname>[^/]+)$
'
,
views
.
SourceStatus
.
as_view
(),
name
=
"importer_source_status"
),
url
(
r
'^
submission/
(?P<pk>\d+)$
'
,
views
.
ShowSubmission
.
as_view
(),
name
=
"importer_submission"
),
path
(
'
logs'
,
views
.
Logs
.
as_view
(),
name
=
"importer_logs"
),
path
(
'
status'
,
views
.
Status
.
as_view
(),
name
=
"importer_status"
),
path
(
'status/<str:sname>
'
,
views
.
SourceStatus
.
as_view
(),
name
=
"importer_source_status"
),
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.views.decorators.csrf
import
csrf_exempt
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
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
import
http
from
dc.mixins
import
VisitorMixin
...
...
signon/models.py
View file @
c3dc08f5
from
__future__
import
annotations
import
json
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.forms.models
import
model_to_dict
from
django.contrib.auth
import
get_user_model
...
...
signon/providers.py
View file @
c3dc08f5
...
...
@@ -58,7 +58,7 @@ class BoundProvider:
Return a dict describing actions for actions that can be taken for this
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
my_user
=
None
other_users
=
set
()
...
...
@@ -131,7 +131,7 @@ class Provider:
class
BoundBaseSessionProvider
(
BoundProvider
):
def
get_actions
(
self
):
from
django.utils.translation
import
u
gettext
as
_
from
django.utils.translation
import
gettext
as
_
from
django.urls
import
reverse
res
=
super
().
get_actions
()
res
.
append
({
...
...
sources/views.py
View file @
c3dc08f5
from
django
import
http
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.edit
import
CreateView
,
UpdateView
,
DeleteView
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