Commit 4ba0c8f5 authored by alexandre.jauneau's avatar alexandre.jauneau

fix all pep8 error

parent a11eceb7
Pipeline #996 passed with stage
in 9 minutes and 20 seconds
......@@ -8,5 +8,6 @@ def main():
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
if __name__ == "__main__":
main()
import datetime
from haystack import indexes
from representatives.models import Representative
class RepresentativeIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.EdgeNgramField(document=True, use_template=True)
slug = indexes.CharField(model_attr='slug', faceted=True)
......
......@@ -21,6 +21,7 @@ class RepresentativeAutocomplete(autocomplete.Select2QuerySetView):
return qs
class ProposalAutocomplete(autocomplete.Select2QuerySetView):
def get_queryset(self):
qs = Proposal.objects.all()
......
......@@ -8,4 +8,5 @@ class SettingAdmin(admin.ModelAdmin):
list_editable = ('key', 'value', 'comment')
list_filter = ('key',)
admin.site.register(Setting, SettingAdmin)
......@@ -7,6 +7,7 @@ from django.utils.encoding import smart_unicode
from django.utils.functional import cached_property
from memopol.utils import strip_accents
class TimeStampedModel(models.Model):
"""
An abstract base class model that provides self-updating
......
......@@ -11,6 +11,7 @@ def publish_positions(modeladmin, request, queryset):
"""Set published to True for the queryset"""
queryset.update(published=True)
publish_positions.short_description = 'Publish selected positions'
......@@ -18,6 +19,7 @@ def unpublish_positions(modeladmin, request, queryset):
"""Set published to False for the queryset"""
queryset.update(published=False)
unpublish_positions.short_description = 'Unpublish selected positions'
......
......@@ -13,4 +13,5 @@ class RecommendationsAdmin(admin.ModelAdmin):
'proposal__dossier__title')
form = RecommendationForm
admin.site.register(Recommendation, RecommendationsAdmin)
......@@ -31,4 +31,6 @@ def skip_votes(sender, vote_data=None, **kwargs):
if vote_data.get('epref', None) not in dossiers:
return False
vote_pre_import.connect(skip_votes)
......@@ -56,6 +56,7 @@ class VoteAdmin(admin.ModelAdmin):
def proposal_reference(self, obj):
return obj.proposal.reference
admin.site.register(Dossier, DossierAdmin)
admin.site.register(Document, DocumentAdmin)
admin.site.register(Proposal, ProposalAdmin)
......
......@@ -26,6 +26,7 @@ def _parse_date(date_str):
date_parse(date_str),
date_timezone('Europe/Brussels'))
JSON_URL = 'http://parltrack.euwiki.org/dumps/ep_votes.json.xz'
DESTINATION = join('/tmp', 'ep_votes.json')
RE_COMVOTE_REF = re.compile(r'&reference=([^&]+)')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment