diff --git a/reddit/admin.py b/reddit/admin.py
new file mode 100644
index 0000000..1098c95
--- /dev/null
+++ b/reddit/admin.py
@@ -0,0 +1,8 @@
+from django.contrib import admin
+from reddit.models import RedditAccount
+
+class RedditAccountAdmin(admin.ModelAdmin):
+ list_display = ('username', 'user', 'date_created', 'link_karma', 'comment_karma')
+ search_fields = ['username', 'user']
+
+admin.site.register(RedditAccount, RedditAccountAdmin)
diff --git a/sso/forms.py b/sso/forms.py
index 3aa3517..cd04892 100644
--- a/sso/forms.py
+++ b/sso/forms.py
@@ -2,6 +2,7 @@ from django import forms
from eve_api.models.api_player import EVEAccount
from sso.models import ServiceAccount, Service
+from reddit.models import RedditAccount
class EveAPIForm(forms.Form):
user_id = forms.CharField(label = u'User ID', max_length=10)
@@ -37,3 +38,14 @@ def UserServiceAccountForm(user):
password = forms.CharField(label = u'Password',widget = forms.PasswordInput(render_value=False))
return ServiceAccountForm
+
+class RedditAccountForm(forms.Form):
+ username = forms.CharField(label = u'User ID', max_length=64)
+
+ def clean(self):
+ try:
+ eaccount = RedditAccount.objects.get(username=self.cleaned_data['username'])
+ except RedditAccount.DoesNotExist:
+ return self.cleaned_data
+ else:
+ raise forms.ValidationError("This User ID is already registered")
diff --git a/sso/urls.py b/sso/urls.py
index 6c3fc55..7a67a2c 100644
--- a/sso/urls.py
+++ b/sso/urls.py
@@ -9,6 +9,9 @@ urlpatterns = patterns('',
(r'^profile/del/eveapi/$', views.eveapi_del),
(r'^profile/del/eveapi/(?P
This is a list of all your current linked Reddit accounts
+{% if redditaccounts %} +| Username | Created Date | |||
|---|---|---|---|---|
| {{ acc.username }} | +{{ acc.date_created }} | +|||
If you encounter any errors during using this service, copy the massive error message into Pastebin and give Matalok a good kicking on IRC/Jabber/Email or on the Forums.
diff --git a/templates/sso/redditaccount.html b/templates/sso/redditaccount.html new file mode 100644 index 0000000..6c337b9 --- /dev/null +++ b/templates/sso/redditaccount.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block title %}Add Reddit Account{% endblock %} + +{% block content %} +This will bind a Reddit account to your Auth Gateway login, this is usually required for application to the +corporation
+Please note, you will be forever tied to this account and posts and comments made on this account will be checked +on from time to time
+ +{% endblock %}