Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Baechler committed Sep 3, 2015
1 parent d9d46f4 commit 06a9b1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 10 additions & 9 deletions elephantblog/extensions/blogping.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def pre_save_handler(sender, instance, **kwargs):
instance.pinging = instance.QUEUED

@staticmethod
def _entry_admin_update_fn(new_state, new_state_dict, short_description=None):
def _entry_admin_update_fn(new_state, new_state_dict,
short_description=None):
def _fn(modeladmin, request, queryset):
rows_updated = queryset.update(**new_state_dict)

Expand All @@ -36,21 +37,21 @@ def handle_model(self):
self.model.add_to_class('SENT', 30)
self.model.add_to_class('UNKNOWN', 0)

PINGING_CHOICES = (
pinging_choices = (
(self.model.SLEEPING, _('sleeping')),
(self.model.QUEUED, _('queued')),
(self.model.SENT, _('sent')),
(self.model.UNKNOWN, _('unknown')),
)

self.model.add_to_class('pinging',
models.SmallIntegerField(
_('ping'),
editable=False,
default=self.model.SLEEPING,
choices=PINGING_CHOICES,
)
)
models.SmallIntegerField(
_('ping'),
editable=False,
default=self.model.SLEEPING,
choices=pinging_choices,
)
)

pre_save.connect(Extension.pre_save_handler, sender=self.model)

Expand Down
2 changes: 0 additions & 2 deletions tests/testapp/tests/test_blogping.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ def testSignal(self):
entry.save()
self.assertEqual(entry.pinging, entry.QUEUED)


def testModelAdmin(self):
modeladmin = ExtensionModelAdmin(Entry, admin.site)
self.assertEqual(type(modeladmin.model), type(Entry))

0 comments on commit 06a9b1d

Please sign in to comment.