--- a/server/src/metaeducation/__init__.py Wed Apr 06 13:32:57 2016 +0200
+++ b/server/src/metaeducation/__init__.py Thu Apr 07 13:21:50 2016 +0200
@@ -1,4 +1,4 @@
-VERSION = (0, 0, 11, "final", 0)
+VERSION = (0, 0, 12, "final", 0)
VERSION_STR = ".".join(map(lambda i:"%02d" % (i,), VERSION[:2]))
--- a/server/src/metaeducation/admin.py Wed Apr 06 13:32:57 2016 +0200
+++ b/server/src/metaeducation/admin.py Thu Apr 07 13:21:50 2016 +0200
@@ -2,6 +2,7 @@
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
+from django.utils.translation import ugettext, ugettext_lazy as _
from .models import User
@@ -57,8 +58,11 @@
list_filter = ('is_staff',)
fieldsets = (
(None, {'fields': ('external_id', 'username')}),
- ('Personal info', {'fields': ('username', 'uai', 'first_name', 'last_name')}),
- ('Permissions', {'fields': ('is_staff',)}),
+ (_('Personal info'), {'fields': ('username', 'uai', 'first_name', 'last_name')}),
+ (_('Permissions'), {'fields': ('is_staff',)}),
+ (_('Permissions'), {'fields': ('is_active', 'is_staff', 'is_superuser',
+ 'groups', 'user_permissions')}),
+ (_('Important dates'), {'fields': ('last_login', 'date_joined')}),
)
# add_fieldsets is not a standard ModelAdmin attribute. UserAdmin
# overrides get_fieldsets to use this attribute when creating a user.
@@ -73,4 +77,4 @@
filter_horizontal = ()
# Now register the new UserAdmin
-admin.site.register(User, UserAdmin)
\ No newline at end of file
+admin.site.register(User, UserAdmin)
--- a/server/src/metaeducation/settings/__init__.py Wed Apr 06 13:32:57 2016 +0200
+++ b/server/src/metaeducation/settings/__init__.py Thu Apr 07 13:21:50 2016 +0200
@@ -51,7 +51,7 @@
'DEFAULT_AUTHENTICATION_CLASSES': (
'metaeducation.auth.MtdcOAuth2ClientCredentialsAuthentication',
'rest_framework.authentication.BasicAuthentication',
- 'rest_framework.authentication.SessionAuthentication',
+ 'renkanmanager.auth.CsrfExemptSessionAuthentication'
)
}
--- a/server/src/metaeducation/signals.py Wed Apr 06 13:32:57 2016 +0200
+++ b/server/src/metaeducation/signals.py Thu Apr 07 13:21:50 2016 +0200
@@ -10,13 +10,15 @@
def reference_created_renkan(sender, instance, created, **kwargs):
from renkanmanager.models import Renkan
+ if not settings.MTDC_CLIENT_CREDENTIALS_TOKEN_URL or not settings.MTDC_REFERENCE_RESOURCE_BASE_URL:
+ return
if created and sender == Renkan and not instance.source_revision_guid:
token_response = requests.post(
settings.MTDC_CLIENT_CREDENTIALS_TOKEN_URL+"?grant_type=client_credentials",
data = {},
headers = {
"Authorization": "Basic %s" % settings.MTDC_AUTH_CODE
- }
+ }
)
if token_response.status_code == 200:
logger.debug("REFERENCING RENKAN: token response is 200")
@@ -39,10 +41,10 @@
headers = {
"Authorization": "Bearer %s" % token,
"content-type": "application/json"
- }
+ }
)
logger.debug("REFERENCING RENKAN: response is %r", reference_response.status_code)
-
+
if not 'test' in sys.argv:
- post_save.connect(reference_created_renkan)
\ No newline at end of file
+ post_save.connect(reference_created_renkan)
--- a/server/src/requirement_iri.txt Wed Apr 06 13:32:57 2016 +0200
+++ b/server/src/requirement_iri.txt Thu Apr 07 13:21:50 2016 +0200
@@ -1,1 +1,1 @@
-renkanmanager (==0.12.17)
+renkanmanager (==0.12.18)