show the warning to users that aren't logged in.
{%if user.is_superuser %}
<h2>You are registered as an administrator. BE CAREFUL!</h2>
{% endif %}
-{%if not has_sshkey %}
+{%if missing_sshkey %}
<p><b>Note!</b> Your ssh key has not yet been registered with the system, or it has not yet replicated
from the main server. Please upload your keys using the
<a href="http://wwwmaster.postgresql.org/community/profile">community account system</a>.</p>
# Utility functions
-def _HasSshkey(userid):
+def _MissingSshkey(user):
+ if not user.is_authenticated():
+ print "Not auth"
+ return False
try:
- gu = GitUser.objects.get(userid=userid)
+ gu = GitUser.objects.get(userid=user.username)
if gu.sshkey != '':
- return True
- else:
return False
+ else:
+ return True
except:
- return False
+ return True
def context_add(request):
return {
- 'has_sshkey': _HasSshkey(request.user.username),
+ 'missing_sshkey': _MissingSshkey(request.user),
}
# Views