Skip to content

Commit

Permalink
pep8/pyflakes cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmcd committed Aug 18, 2012
1 parent 3062960 commit 277d830
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion core/forms.py
Expand Up @@ -16,4 +16,3 @@ def __init__(self, *args, **kwargs):
self.fields[name].widget.input_type = "number"
if field.required:
self.fields[name].widget.attrs["required"] = ""

2 changes: 0 additions & 2 deletions core/management/commands/socketio_server.py
Expand Up @@ -11,5 +11,3 @@ class Command(BaseCommand):
def handle(self, *args, **options):
game.autodiscover()
SocketIOServer(("0.0.0.0", 9000), Application()).serve_forever()


5 changes: 3 additions & 2 deletions core/models.py
Expand Up @@ -26,7 +26,7 @@ def user_saved(sender, **kwargs):
"""
Create an initial account balance for new users.
"""
account = Account.objects.get_or_create(user=kwargs["instance"])
Account.objects.get_or_create(user=kwargs["instance"])


@receiver(socialauth_registered, sender=None)
Expand All @@ -41,7 +41,8 @@ def avatar(sender, user, response, details, **kwargs):
photo_url = "_reasonably_small".join(photo_url.rsplit("_normal", 1))
except KeyError:
# facebook
photo_url = "http://graph.facebook.com/%s/picture?type=large" % response["id"]
uid = response["id"]
photo_url = "http://graph.facebook.com/%s/picture?type=large" % uid
path = join(settings.MEDIA_ROOT, "photos")
if not exists(path):
makedirs(path)
Expand Down
3 changes: 2 additions & 1 deletion core/settings.py
Expand Up @@ -6,4 +6,5 @@
DEFAULT_BALANCE = getattr(settings, "DEFAULT_BALANCE", 5000)

# Number of seconds until a game is played, after the first player joins.
BETTING_PERIOD = getattr(settings, "BETTING_PERIOD", int(not settings.DEBUG) * 10)
BETTING_PERIOD = int(not settings.DEBUG) * 10
BETTING_PERIOD = getattr(settings, "BETTING_PERIOD", BETTING_PERIOD)
2 changes: 1 addition & 1 deletion core/urls.py
@@ -1,5 +1,5 @@

from django.conf.urls.defaults import patterns, include, url
from django.conf.urls.defaults import patterns, url


urlpatterns = patterns("core.views",
Expand Down
3 changes: 3 additions & 0 deletions core/views.py
Expand Up @@ -10,14 +10,17 @@
def index(request):
return render(request, "index.html", {"games": game_registry.values()})


def logged_in(request):
info(request, _("Logged in as %s" % request.user))
return redirect("index")


def login_error(request):
error(request, _("An error occurred logging in"))
return redirect("index")


def logout(request):
auth_logout(request)
info(request, _("Successfully logged out"))
Expand Down
1 change: 0 additions & 1 deletion urls.py
@@ -1,6 +1,5 @@

from django.conf.urls.defaults import patterns, include, url
from django.conf import settings
from django.contrib import admin

from core import game
Expand Down

0 comments on commit 277d830

Please sign in to comment.