Commits

James Bennett committed b6b213d

Some PEP8 cleanup.

Comments (0)

Files changed (4)

registration/backends/default/urls.py

 urlpatterns = patterns('',
                        url(r'^activate/complete/$',
                            direct_to_template,
-                           { 'template': 'registration/activation_complete.html' },
+                           {'template': 'registration/activation_complete.html'},
                            name='registration_activation_complete'),
                        # Activation keys get matched by \w+ instead of the more specific
                        # [a-fA-F0-9]{40} because a bad activation key should still get to the view;
                        # confusing 404.
                        url(r'^activate/(?P<activation_key>\w+)/$',
                            activate,
-                           { 'backend': 'registration.backends.default.DefaultBackend' },
+                           {'backend': 'registration.backends.default.DefaultBackend'},
                            name='registration_activate'),
                        url(r'^register/$',
                            register,
-                           { 'backend': 'registration.backends.default.DefaultBackend' },
+                           {'backend': 'registration.backends.default.DefaultBackend'},
                            name='registration_register'),
                        url(r'^register/complete/$',
                            direct_to_template,
-                           { 'template': 'registration/registration_complete.html' },
+                           {'template': 'registration/registration_complete.html'},
                            name='registration_complete'),
                        url(r'^register/closed/$',
                            direct_to_template,
-                           { 'template': 'registration/registration_closed.html' },
+                           {'template': 'registration/registration_closed.html'},
                            name='registration_disallowed'),
                        (r'', include('registration.auth_urls')),
                        )

registration/forms.py

 # on them with CSS or JavaScript if they have a class of "required"
 # in the HTML. Your mileage may vary. If/when Django ticket #3515
 # lands in trunk, this will no longer be necessary.
-attrs_dict = { 'class': 'required' }
+attrs_dict = {'class': 'required'}
 
 
 class RegistrationForm(forms.Form):
                                 max_length=30,
                                 widget=forms.TextInput(attrs=attrs_dict),
                                 label=_("Username"),
-                                error_messages={ 'invalid': _("This value must contain only letters, numbers and underscores.") })
+                                error_messages={'invalid': _("This value must contain only letters, numbers and underscores.")})
     email = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict,
                                                                maxlength=75)),
                              label=_("Email address"))
     """
     tos = forms.BooleanField(widget=forms.CheckboxInput(attrs=attrs_dict),
                              label=_(u'I have read and agree to the Terms of Service'),
-                             error_messages={ 'required': _("You must agree to the terms to register") })
+                             error_messages={'required': _("You must agree to the terms to register")})
 
 
 class RegistrationFormUniqueEmail(RegistrationForm):

registration/models.py

             framework for details regarding these objects' interfaces.
 
         """
-        ctx_dict = { 'activation_key': self.activation_key,
-                     'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
-                     'site': site }
+        ctx_dict = {'activation_key': self.activation_key,
+                    'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
+                    'site': site}
         subject = render_to_string('registration/activation_email_subject.txt',
                                    ctx_dict)
         # Email subject *must not* contain newlines

registration/views.py

         context[key] = callable(value) and value() or value
 
     return render_to_response(template_name,
-                              { 'form': form },
+                              {'form': form},
                               context_instance=context)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.