From: Matthijs Kooijman Date: Sat, 9 Feb 2008 18:34:17 +0000 (+0100) Subject: * Replace some tabs by spaces and put a vim modeline in every python file. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=f1833394374f434a61ab1ab9a551f2bded207182;p=matthijs%2Fprojects%2Fxerxes.git * Replace some tabs by spaces and put a vim modeline in every python file. --- diff --git a/__init__.py b/__init__.py index e69de29..14c59e8 100644 --- a/__init__.py +++ b/__init__.py @@ -0,0 +1 @@ +# vim: set sts=4 sw=4 expandtab: diff --git a/auth.py b/auth.py index 64f4daf..00c106d 100644 --- a/auth.py +++ b/auth.py @@ -104,3 +104,4 @@ class PhpBBBackend: except User.DoesNotExist: return None +# vim: set sts=4 sw=4 expandtab: diff --git a/base/__init__.py b/base/__init__.py index e69de29..14c59e8 100644 --- a/base/__init__.py +++ b/base/__init__.py @@ -0,0 +1 @@ +# vim: set sts=4 sw=4 expandtab: diff --git a/base/models.py b/base/models.py index 9d910f3..806b4ec 100644 --- a/base/models.py +++ b/base/models.py @@ -26,3 +26,4 @@ class UserProfile(models.Model): class Admin: pass +# vim: set sts=4 sw=4 expandtab: diff --git a/base/views.py b/base/views.py index 60f00ef..c13509e 100644 --- a/base/views.py +++ b/base/views.py @@ -1 +1,2 @@ # Create your views here. +# vim: set sts=4 sw=4 expandtab: diff --git a/events/__init__.py b/events/__init__.py index e69de29..14c59e8 100644 --- a/events/__init__.py +++ b/events/__init__.py @@ -0,0 +1 @@ +# vim: set sts=4 sw=4 expandtab: diff --git a/events/models.py b/events/models.py index a283adf..bb8f68b 100644 --- a/events/models.py +++ b/events/models.py @@ -22,3 +22,4 @@ class Event(models.Model): class Registration(models.Model): person = models.ForeignKey(User, edit_inline=models.STACKED, num_in_admin=3) event = models.ForeignKey(Event, core=True) +# vim: set sts=4 sw=4 expandtab: diff --git a/events/views.py b/events/views.py index e69de29..14c59e8 100644 --- a/events/views.py +++ b/events/views.py @@ -0,0 +1 @@ +# vim: set sts=4 sw=4 expandtab: diff --git a/import.py b/import.py index 26d0af1..df1a1ac 100644 --- a/import.py +++ b/import.py @@ -80,3 +80,4 @@ for row in c.fetchall(): p.save() except Exception: print props +# vim: set sts=4 sw=4 expandtab: diff --git a/influences/__init__.py b/influences/__init__.py index d1e981c..e1dd01a 100644 --- a/influences/__init__.py +++ b/influences/__init__.py @@ -1 +1,2 @@ import notify +# vim: set sts=4 sw=4 expandtab: diff --git a/influences/models.py b/influences/models.py index 6094181..9587aff 100644 --- a/influences/models.py +++ b/influences/models.py @@ -55,3 +55,4 @@ class Influence(models.Model): verbose_name = _("Influence") verbose_name_plural = _("Influences") +# vim: set sts=4 sw=4 expandtab: diff --git a/influences/notify.py b/influences/notify.py index f078bc9..7b47e8c 100644 --- a/influences/notify.py +++ b/influences/notify.py @@ -14,3 +14,4 @@ def influence_saved(instance, created): notify([instance.character.player, 'lextalionis@evolution-events.nl'], 'influences/email/influence_changed.html', {'influence' : instance, 'created' : created}) dispatcher.connect(influence_saved, signals.post_save, Influence) +# vim: set sts=4 sw=4 expandtab: diff --git a/influences/views.py b/influences/views.py index 51cfb49..71e69ed 100644 --- a/influences/views.py +++ b/influences/views.py @@ -37,12 +37,12 @@ def add(request, character_id=None): f = InfluenceForm(request=request, initial=initial) if (f.is_valid()): influence = f.save(commit=False) - if (influence.character.player == request.user): - influence.save() - return HttpResponseRedirect(reverse('influences_influence_detail', args=[influence.id])) - else: - # TODO: Make this a bit more pretty. Perhaps throw an exception here and add some middleware to catch it? - return HttpResponseForbidden("Forbidden -- Trying to submit influence for somebody else's character") + if (influence.character.player == request.user): + influence.save() + return HttpResponseRedirect(reverse('influences_influence_detail', args=[influence.id])) + else: + # TODO: Make this a bit more pretty. Perhaps throw an exception here and add some middleware to catch it? + return HttpResponseForbidden("Forbidden -- Trying to submit influence for somebody else's character") # Only allow characters of the current user f.fields['character']._set_queryset(chars) @@ -77,3 +77,5 @@ def character_detail(*args, **kwargs): @login_required def influence_detail(*args, **kwargs): return object_detail(*args, **kwargs) + +# vim: set sts=4 sw=4 expandtab: diff --git a/manage.py b/manage.py index bcdd55e..ec3efa6 100755 --- a/manage.py +++ b/manage.py @@ -9,3 +9,4 @@ except ImportError: if __name__ == "__main__": execute_manager(settings) +# vim: set sts=4 sw=4 expandtab: diff --git a/settings.py b/settings.py index ba3582d..dfe7fce 100644 --- a/settings.py +++ b/settings.py @@ -115,3 +115,4 @@ AUTHENTICATION_BACKENDS = ( ) AUTH_PROFILE_MODULE = 'base.UserProfile' +# vim: set sts=4 sw=4 expandtab: diff --git a/tools/__init__.py b/tools/__init__.py index e69de29..14c59e8 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -0,0 +1 @@ +# vim: set sts=4 sw=4 expandtab: diff --git a/tools/context_processors.py b/tools/context_processors.py index b0d0282..fd3c57a 100644 --- a/tools/context_processors.py +++ b/tools/context_processors.py @@ -10,3 +10,4 @@ def static(request): """ return {'STATIC_URL_PREFIX': settings.STATIC_URL_PREFIX} +# vim: set sts=4 sw=4 expandtab: diff --git a/tools/forms.py b/tools/forms.py index b3171e3..b420e1f 100644 --- a/tools/forms.py +++ b/tools/forms.py @@ -34,4 +34,4 @@ class BaseContextModelForm(BaseModelForm): class ContextModelForm(BaseContextModelForm): __metaclass__ = ModelFormMetaclass -# vim:set sts=4 ts=4 sw=4 ai et: +# vim: set sts=4 sw=4 expandtab: diff --git a/tools/misc.py b/tools/misc.py index 110c370..1edf472 100644 --- a/tools/misc.py +++ b/tools/misc.py @@ -13,3 +13,4 @@ def make_iter(value): except TypeError: pass return [value] +# vim: set sts=4 sw=4 expandtab: diff --git a/tools/notify.py b/tools/notify.py index 8dca1ba..74f1083 100644 --- a/tools/notify.py +++ b/tools/notify.py @@ -55,3 +55,4 @@ def notify(recipients, template, context = {}): headers = headers_dict ) msg.send() +# vim: set sts=4 sw=4 expandtab: diff --git a/tools/templatetags/__init__.py b/tools/templatetags/__init__.py index e69de29..14c59e8 100644 --- a/tools/templatetags/__init__.py +++ b/tools/templatetags/__init__.py @@ -0,0 +1 @@ +# vim: set sts=4 sw=4 expandtab: diff --git a/urls.py b/urls.py index 652b7a9..c6e6fe1 100644 --- a/urls.py +++ b/urls.py @@ -36,3 +36,4 @@ if settings.DEBUG: (r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': os.path.join(settings.PROJECT_DIR, 'static')}), ) +# vim: set sts=4 sw=4 expandtab: