<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,7 @@
 from django import forms
 from django.contrib.auth.models import User
 from django.utils.translation import ugettext as _
+from django.conf import settings
 
 import re
 username_re = re.compile('^[a-zA-Z0-9]+$')
@@ -15,7 +16,11 @@ class RegistrationForm(forms.Form):
     password2 = forms.CharField(label=_(&quot;Password Confirmation&quot;), max_length=16, widget=forms.PasswordInput)
     
     def clean_username(self):
-        username = self.cleaned_data.get(&quot;username&quot;)
+        username = self.cleaned_data.get(&quot;username&quot;).lower()
+        if username in getattr(settings, 'RESERVED_USERNAMES', []):
+            raise forms.ValidationError(_(
+                'That username cannot be registered'
+            ))
         try:
             User.objects.get(username=username)
         except User.DoesNotExist:</diff>
      <filename>registration/forms.py</filename>
    </modified>
    <modified>
      <diff>@@ -83,6 +83,14 @@ INSTALLED_APPS = (
     'bugle',
 )
 
+RESERVED_USERNAMES = (
+    'admin', 'all', 'toggle', 'favourite', 'favourites', 'stats', 'mentions',
+    'pastes', 'paste', 'upload', 'uploads', 'files', 'file', 'images',
+    'image', 'photos', 'photo', 'pic', 'todos', 'todo', 'blast', 'blasts',
+    'bugle', 'autorefresh', 'ajax', 'polling', 'poll', 'post', 'delete', 
+    'account', 'openid', 'logout', 'login', 'static', 'link', 'links'
+)
+
 try:
     from local_settings import *
 except ImportError:
@@ -95,4 +103,3 @@ TEMPLATE_CONTEXT_PROCESSORS = (
     'django.core.context_processors.media',
     'django.core.context_processors.request',
 )
-</diff>
      <filename>settings.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>90cd8e22f8bf84f92f8112377581bb85eed8a59b</id>
    </parent>
  </parents>
  <author>
    <name>Simon Willison</name>
    <email>simon@simonwillison.net</email>
  </author>
  <url>http://github.com/simonw/bugle_project/commit/4fbf7d8c454d2b6eccdf486baf08999d331f1d87</url>
  <id>4fbf7d8c454d2b6eccdf486baf08999d331f1d87</id>
  <committed-date>2009-06-08T01:00:32-07:00</committed-date>
  <authored-date>2009-06-08T01:00:32-07:00</authored-date>
  <message>Added reserved usernames</message>
  <tree>edeb282b5b1482deeffe6b5a86277c0477f5502f</tree>
  <committer>
    <name>Simon Willison</name>
    <email>simon@simonwillison.net</email>
  </committer>
</commit>
