Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Making the TwitterPlugin's registration_form_class accept the new 're…

…quest' argument to its __init__ funciton.
  • Loading branch information...
commit 75a16ca9d4f9fb63e3423a1687817dbdb78bd509 1 parent 8f0e1cb
@adamalton adamalton authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 twitterplugin/forms.py
View
7 twitterplugin/forms.py
@@ -14,6 +14,13 @@ class Meta:
twitter_username = forms.CharField()
+
+ def __init__(self, request, *args, **kwargs):
+ """ Take the extra 'request' argument, and attach it to self. """
+ self.request = request
+ return super(TwitterPluginRegistrationForm, self).__init__(*args, **kwargs)
+
+
def clean_twitter_username(self):
value = self.cleaned_data['twitter_username']
if re.search("[^a-z0-9_-]", value, re.IGNORECASE): #TODO: This regex may be wrong
Please sign in to comment.
Something went wrong with that request. Please try again.