pep8 fixes

This commit is contained in:
Thomas Waldmann 2013-09-29 01:21:44 +02:00
parent 0093aab667
commit ac4860f54a
12 changed files with 31 additions and 34 deletions

View File

@ -3,8 +3,8 @@
from django import forms
from django.contrib.auth.models import User
class UserProfileForm(forms.ModelForm):
class Meta:
model = User
fields = ['first_name', 'last_name', ]

View File

@ -1,14 +1,12 @@
from django.conf.urls import patterns, include, url
from accounts.views import (
UserProfileView
)
from accounts.views import UserProfileView
from django.contrib.auth.views import password_change
urlpatterns = patterns('',
urlpatterns = patterns(
'',
url(r'^profile/', UserProfileView.as_view(), name="account_profile"),
url(r'^change_pw/', password_change, {
'template_name': 'registration/password_change.html',
'post_change_redirect': '/account/profile/',
},
name="password_change"),
)
'post_change_redirect': '/account/profile/', },
name="password_change"), )

View File

@ -31,4 +31,3 @@ class PasswordChangeView(TemplateView):
context = super(PasswordChangeView, self).get_context_data(*args, **kwargs)
context['nav_change_password'] = True
return context

View File

@ -1,4 +1,5 @@
from main.models import *
from django.contrib import admin
admin.site.register(Host)

View File

@ -2,8 +2,8 @@
from django import forms
from main.models import Host
class HostForm(forms.ModelForm):
class Meta:
model = Host
fields = ['fqdn', 'comment', 'update_secret']

View File

@ -17,7 +17,6 @@ class Host(models.Model):
return u"%s - %s" % (self.fqdn, self.comment)
class HostForm(ModelForm):
class Meta:
model = Host

View File

@ -55,6 +55,7 @@ class OverviewView(CreateView):
context['hosts'] = Host.objects.filter(created_by=self.request.user)
return context
class HostView(UpdateView):
model = Host
template_name = "main/host.html"
@ -87,6 +88,7 @@ class HostView(UpdateView):
context['hosts'] = Host.objects.filter(created_by=self.request.user)
return context
class DeleteHostView(DeleteView):
model = Host
template_name = "main/delete_host.html"
@ -110,5 +112,3 @@ class DeleteHostView(DeleteView):
context['nav_overview'] = True
context['hosts'] = Host.objects.filter(created_by=self.request.user)
return context

View File

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
from django.conf import settings
def add_settings(request):
context = {}
context['WWW_IPV4_HOST'] = settings.WWW_IPV4_HOST
context['WWW_IPV6_HOST'] = settings.WWW_IPV6_HOST
return context

View File

@ -20,7 +20,7 @@ DATABASES = {
'USER': '',
'PASSWORD': '',
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '', # Set to empty string for default.
'PORT': '' # Set to empty string for default.
}
}
@ -211,4 +211,3 @@ try:
from .local_settings import *
except ImportError:
pass

View File

@ -4,7 +4,8 @@ from django.views.generic import TemplateView
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
urlpatterns = patterns(
'',
url(r'^accounts/', include('registration.backends.default.urls')),
url(r'^account/', include('accounts.urls')),
url(r'^admin/', include(admin.site.urls)),
@ -15,5 +16,4 @@ from django.conf import settings
if settings.DEBUG:
urlpatterns += patterns('django.contrib.staticfiles.views',
url(r'^static/(?P<path>.*)$', 'serve'),
)
url(r'^static/(?P<path>.*)$', 'serve'), )

View File

@ -30,4 +30,5 @@ pep8ignore =
*.py E124 # closing bracket does not match visual indentation (behaves strange!?)
*.py E125 # continuation line does not distinguish itself from next logical line (difficult to avoid!)
docs/conf.py ALL # sphinx stuff, automatically generated, don't check this
migrations/*.py ALL # autogenerated by South