Skip to content
Extraits de code Groupes Projets
Valider bd3a6ee0 rédigé par Jamesie Pic's avatar Jamesie Pic
Parcourir les fichiers

Insane bug fix

This code was just preventing administrators to publish recommendations
!
parent 5e95178d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -293,5 +293,4 @@ CONSTANCE_CONFIG = {
'USE_COUNTRY': (True, 'Use country for representative'),
'MAIN_GROUP_KIND': ('group', 'Main group kind'),
'ORGANIZATION_NAME': ('La Quadrature du Net', 'Organization name'),
'POSITION_PUBLISHED': (False, 'Default position published status')
}
......@@ -18,7 +18,6 @@
#
# Copyright (C) 2015 Arnaud Fabre <af@laquadrature.net>
from constance import config
from django.db import models
from django.template.defaultfilters import truncatewords
from taggit.managers import TaggableManager
......@@ -28,8 +27,6 @@ from legislature.models import MemopolRepresentative
class PositionManager(models.Manager):
"""A simple model manager for querying published Positions"""
# https://docs.djangoproject.com/en/1.8/topics/db/managers/#using-managers-for-related-object-access
use_for_related_fields = True
def published(self, **kwargs):
......@@ -49,11 +46,6 @@ class Position(models.Model):
# Adds our custom manager
objects = PositionManager()
def save(self, *args, **kwargs):
""" Set published to default value and save the model"""
self.published = config.POSITION_PUBLISHED
super(Position, self).save(*args, **kwargs)
@property
def short_text(self):
return truncatewords(self.text, 5)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter