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
Political Memory
memopol
Commits
20cd39ca
Commit
20cd39ca
authored
Jul 01, 2015
by
Arnaud Fabre
Browse files
bug fixes
parent
71da78ad
Changes
3
Show whitespace changes
Inline
Side-by-side
legislature/management/commands/update_memopol_representatives.py
View file @
20cd39ca
...
@@ -10,4 +10,4 @@ class Command(BaseCommand):
...
@@ -10,4 +10,4 @@ class Command(BaseCommand):
@
transaction
.
atomic
@
transaction
.
atomic
def
handle
(
self
,
*
args
,
**
options
):
def
handle
(
self
,
*
args
,
**
options
):
for
representative
in
MemopolRepresentative
.
objects
.
all
():
for
representative
in
MemopolRepresentative
.
objects
.
all
():
representative
.
update_
s
co
re
()
representative
.
update_co
untry
()
legislature/models.py
View file @
20cd39ca
...
@@ -107,7 +107,6 @@ class MemopolRepresentative(Representative):
...
@@ -107,7 +107,6 @@ class MemopolRepresentative(Representative):
@
receiver
(
post_save
,
sender
=
Representative
)
@
receiver
(
post_save
,
sender
=
Representative
)
def
create_memopolrepresentative_from_representative
(
instance
,
**
kwargs
):
def
create_memopolrepresentative_from_representative
(
instance
,
**
kwargs
):
create_child_instance_from_parent
(
MemopolRepresentative
,
instance
)
create_child_instance_from_parent
(
MemopolRepresentative
,
instance
)
pass
@
receiver
(
post_save
,
sender
=
Mandate
)
@
receiver
(
post_save
,
sender
=
Mandate
)
...
...
legislature/templatetags/by_group_url.py
View file @
20cd39ca
from
django
import
template
from
django
import
template
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
representatives.models
import
Mandate
from
representatives.models
import
Mandate
,
Group
register
=
template
.
Library
()
register
=
template
.
Library
()
...
@@ -11,6 +11,9 @@ def by_group_url(group):
...
@@ -11,6 +11,9 @@ def by_group_url(group):
if
isinstance
(
group
,
Mandate
):
if
isinstance
(
group
,
Mandate
):
group
=
group
.
group
group
=
group
.
group
if
not
isinstance
(
group
,
Group
):
return
''
kwargs
=
{
'group_kind'
:
group
.
kind
}
kwargs
=
{
'group_kind'
:
group
.
kind
}
if
group
.
abbreviation
:
if
group
.
abbreviation
:
...
...
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