Move source into src/ subdirectory and add missing templates and locales to source distribution

This commit is contained in:
Benjamin Dauvergne 2014-10-12 09:27:53 +02:00
parent 7eac84c8bd
commit 01a1c2d973
21 changed files with 27 additions and 9 deletions

View File

@ -1 +0,0 @@
{% extends "rest_framework/base.html" %}

View File

@ -8,7 +8,7 @@ def get_version():
import os
version = None
for d in glob.glob('*'):
for d in glob.glob('src/*'):
if not os.path.isdir(d):
continue
module_file = os.path.join(d, '__init__.py')
@ -38,8 +38,23 @@ setup(name='authentic2-auth-saml2',
description='Authentic2 Auth SAML2',
author="Entr'ouvert",
author_email="info@entrouvert.com",
packages=find_packages(os.path.dirname(__file__) or '.'),
install_requires=[],
packages=find_packages('src'),
package_dir={
'': 'src',
},
install_requires=[
'django-mellon',
],
package_data={
'authentic2_auth_saml2': [
'templates/authsaml2/*.html',
'locale/fr/LC_MESSAGES/django.po',
'locale/fr/LC_MESSAGES/django.mo',
'static/authentic2_auth_kerberos/js/*.js',
'static/authentic2_auth_kerberos/css/*.css',
'static/authentic2_auth_kerberos/img/*.png',
],
},
entry_points={
'authentic2.plugin': [
'authentic-auth-saml2 = authentic2_auth_saml2:Plugin',

View File

@ -1,7 +1,7 @@
from django.db import models
import django
from django.utils.translation import ugettext_lazy as _
from django.db.models.manager import EmptyManager
from django.contrib.auth.models import _user_get_all_permissions, _user_has_perm, _user_has_module_perms
from django.contrib.auth.models import _user_get_all_permissions, _user_has_perm, _user_has_module_perms, Group, Permission
class FakePk:
@ -19,8 +19,12 @@ class SAML2TransientUser(object):
is_staff = False
is_active = False
is_superuser = False
_groups = EmptyManager()
_user_permissions = EmptyManager()
if django.VERSION >= (1, 6, 0):
_groups = EmptyManager(Group)
_user_permissions = EmptyManager(Permission)
else:
_groups = EmptyManager()
_user_permissions = EmptyManager()
_meta = FakeMeta()
def __init__(self, id):

View File

@ -655,7 +655,7 @@ def get_provider_id_and_options(provider_id):
if not provider_id:
provider_id = reverse('a2-auth-saml2-metadata')
options = metadata_options
options.update(app_settings.AUTHSAML2_METADATA_OPTIONS)
options.update(app_settings.METADATA_OPTIONS)
return provider_id, options
def get_metadata(request, provider_id=None):