Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
piphone
campaign
Commits
bc71115f
Commit
bc71115f
authored
Jun 14, 2017
by
Okhin
Browse files
Fixing the organization page
parent
b4c50a97
Pipeline
#1150
passed with stage
in 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
picampaign/organization/admin.py
View file @
bc71115f
...
...
@@ -17,6 +17,8 @@ class GroupInline(admin.TabularInline):
class
GroupTypeAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'name'
,
'organization'
,)
list_filter
=
(
'organization'
,)
inlines
=
[
GroupInline
]
def
get_queryset
(
self
,
request
):
...
...
@@ -37,6 +39,10 @@ class GroupTypeAdmin(admin.ModelAdmin):
class
GroupAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'name'
,
'type'
,
'organization'
,)
list_filter
=
(
'type'
,)
search_fields
=
[
'name'
,]
def
get_queryset
(
self
,
request
):
qs
=
super
(
GroupAdmin
,
self
).
get_queryset
(
request
)
if
request
.
user
.
is_superuser
:
...
...
picampaign/organization/models.py
View file @
bc71115f
...
...
@@ -38,6 +38,9 @@ class Group(models.Model):
contacts
=
models
.
ManyToManyField
(
Contact
,
blank
=
True
,
related_name
=
'groups'
)
def
organization
(
self
):
return
self
.
type
.
organization
def
__str__
(
self
):
return
self
.
name
...
...
Write
Preview
Supports
Markdown
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