Skip to content

Commit

Permalink
🏭 "somebody's always throwing bricks"
Browse files Browse the repository at this point in the history
  • Loading branch information
zackmdavis committed Oct 12, 2014
1 parent 9e1b7b6 commit 2398cba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
10 changes: 6 additions & 4 deletions core/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ class Meta:
lambda n: "The Post About the Number {}".format(n)
)
slug = factory.LazyAttribute(lambda p: slugify(p.title))
content = """*Lorem Ipsum* is simply dummy text of the printing and
typesetting industry. Lorem Ipsum has been the industry's standard
dummy text ever since the *1500s*, when an unknown printer took a
galley of type and scrambled it to make a type specimen book."""
content = (
"*Lorem Ipsum* is simply dummy text of the printing and "
"typesetting industry. Lorem Ipsum has been the industry's standard "
"dummy text ever since the *1500s*, when an unknown printer took a "
"galley of type and scrambled it to make a type specimen book."
)
published_at = datetime.now()
10 changes: 9 additions & 1 deletion core/votable.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from markdown import markdown
import logging
from html.parser import HTMLParser

from markdown import markdown

logger = logging.getLogger(__name__)

class Tagnostic(HTMLParser):
def __init__(self, content):
Expand Down Expand Up @@ -61,6 +64,11 @@ def accept_vote(self, voter, selection, value):
start_index=start_index, end_index=end_index
)
else:
logger.info(
"invalid vote selection on {} #{}: {}".format(
self.__class__.__name__, self.pk, selection
)
)
raise VotingException("Can't find selection in content!")

def render(self):
Expand Down
7 changes: 4 additions & 3 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
},
'handlers': {
'file': {
'level': 'DEBUG',
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'maxBytes': 1 * (1024)**2, # 1 MiB
'backupCount': 3,
Expand All @@ -96,11 +96,12 @@
'django': {
'handlers':['file'],
'propagate': True,
'level':'DEBUG',
'level':'INFO',
},
'core': {
'handlers': ['file'],
'level': 'DEBUG',
'propogate': True,
'level': 'INFO',
},
}
}
Expand Down

0 comments on commit 2398cba

Please sign in to comment.