Commit ddbf3e8e authored by Kroustouris Stauros's avatar Kroustouris Stauros

cleanup and fixes

parent 662c6e85
......@@ -6,7 +6,6 @@ from django.template.context import RequestContext
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from registration.models import RegistrationProfile
from registration.views import activate as registration_activate
from accounts.models import *
from edumanage.forms import *
import logging
......@@ -35,17 +34,17 @@ def activate(request, activation_key):
{ 'account': account,
'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS },
context_instance=context)
form = UserProfileForm(instance=userProfile)
form.fields['user'] = forms.ModelChoiceField(queryset=User.objects.filter(pk=rp.user.pk), empty_label=None)
form.fields['institution'] = forms.ModelChoiceField(queryset=Institution.objects.all(), empty_label=None)
return render_to_response("registration/activate_edit.html",
{ 'account': account,
'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS,
'form': form },
context_instance=context)
if request.method == "POST":
context = RequestContext(request)
request_data = request.POST.copy()
......@@ -54,7 +53,7 @@ def activate(request, activation_key):
up = user.get_profile()
up.institution = Institution.objects.get(pk=request_data['institution'])
up.save()
except:
return render_to_response("registration/activate_edit.html",
{ 'account': account,
......@@ -71,7 +70,7 @@ def activate(request, activation_key):
except Exception as e:
logger.info("An error occured: %s" %e)
pass
if account:
# A user has been activated
email = render_to_string("registration/activation_complete.txt",
......
......@@ -28,11 +28,10 @@ DEBUG = True
TEMPLATE_DEBUG = DEBUG
here = lambda x: os.path.join(os.path.abspath(os.path.dirname(__file__)), x)
djnro_path = os.path.join(os.path.abspath(os.path.dirname(__file__)))
project_path = os.path.abspath(os.path.dirname(__name__))
ADMINS = (
# ('Leonidas Poulopoulos', 'leopoul@noc.grnet.gr'),
# ('Zenon Mousmoulas', 'zmousm@noc.grnet.gr'),
('Stavros Kroustouris', 'staurosk@noc.grnet.gr'),
)
......@@ -105,9 +104,10 @@ MEDIA_URL = ''
ADMIN_MEDIA_PREFIX = '/media/'
STATIC_URL = '/static/'
STATIC_ROOT = '/path/to/static/root'
# STATIC_ROOT = os.path.join(project_path, 'static')
print os.path.join(project_path, 'static')
STATICFILES_DIRS = [
'/path/to/staticfiles/dirs',
os.path.join(project_path, 'static'),
]
......@@ -117,6 +117,7 @@ STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
AUTHENTICATION_BACKENDS = (
'djangobackends.shibauthBackend.shibauthBackend',
......@@ -189,7 +190,7 @@ ROOT_URLCONF = 'djnro.urls'
WSGI_APPLICATION = 'djnro.wsgi.application'
TEMPLATE_DIRS = (
"/example/templates",
os.path.join(djnro_path, 'templates/'),
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
......
......@@ -7,5 +7,6 @@ httplib2==0.9
ipaddr==2.1.11
lxml==3.4.0
oauth2==1.5.211
python-openid==2.2.5
requests==2.4.1
wsgiref==0.1.2
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment