summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-02 16:21:08 -0500
committerDan McGee <dan@archlinux.org>2011-06-02 16:21:08 -0500
commit1840416b9e8892a685202f30b4079fd04607151f (patch)
treeaf3ed598458bde0813559417c072e53d4fecdec3 /devel
parentcc4fef23e2b4da4744224f5b2c0dbb679834aa49 (diff)
Add a PGP key field on the dev profile
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rw-r--r--devel/views.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/devel/views.py b/devel/views.py
index 475376ad..25ad2ccf 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -102,6 +102,13 @@ class ProfileForm(forms.Form):
return self.cleaned_data
class UserProfileForm(forms.ModelForm):
+ def clean_pgp_key(self):
+ data = self.cleaned_data['pgp_key']
+ # strip 0x prefix if provided; store uppercase
+ if data.startswith('0x'):
+ data = data[2:]
+ return data.upper()
+
class Meta:
model = UserProfile
exclude = ['allowed_repos', 'user']