Mercurial > public > sg101
comparison user_photos/forms.py @ 972:7138883966b3
Started unit tests for hotlinking images.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 23 Sep 2015 21:26:09 -0500 |
parents | 4f265f61874b |
children | f5aa74dcdd7a |
comparison
equal
deleted
inserted
replaced
971:4f265f61874b | 972:7138883966b3 |
---|---|
142 cleaned_data = super(HotLinkImageForm, self).clean() | 142 cleaned_data = super(HotLinkImageForm, self).clean() |
143 rate_limit_user(self.user) | 143 rate_limit_user(self.user) |
144 return cleaned_data | 144 return cleaned_data |
145 | 145 |
146 def save(self): | 146 def save(self): |
147 import pdb; pdb.set_trace() | |
148 | |
149 url = self.url_parts.geturl() | 147 url = self.url_parts.geturl() |
150 if (self.url_parts.scheme == 'https' and | 148 if (self.url_parts.scheme == 'https' and |
151 self.url_parts.hostname in settings.USER_IMAGES_SOURCES): | 149 self.url_parts.hostname in settings.USER_IMAGES_SOURCES): |
152 return url | 150 return url |
153 | 151 |