Skip to content

Commit

Permalink
Merge pull request #637 from uktrade/release/avery
Browse files Browse the repository at this point in the history
Release Avery
  • Loading branch information
marcofucci authored Nov 14, 2017
2 parents 729b488 + a3aa62d commit e14350f
Show file tree
Hide file tree
Showing 40 changed files with 8,721 additions and 4,572 deletions.
2 changes: 0 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
DJANGO_SETTINGS_MODULE: config.settings.local
ES_INDEX: test_index
ES5_URL: http://localhost:9200
CDMS_AUTH_URL: http://example.com
AWS_DEFAULT_REGION: eu-west-2
AWS_ACCESS_KEY_ID: foo
AWS_SECRET_ACCESS_KEY: bar
Expand Down Expand Up @@ -57,7 +56,6 @@ jobs:
name: Run tests
command: |
set -xu
./tests-auth.sh
./tests.sh
- run:
Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ tests:
docker-compose build
docker-compose run leeloo bash tests.sh

tests-auth:
docker-compose build
docker-compose run leeloo bash tests-auth.sh

flake8:
docker-compose build
docker-compose run leeloo flake8
Expand Down
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ To run the tests:
```shell
bash tests.sh
bash tests-auth.sh
```
To run the linter:
Expand Down Expand Up @@ -190,7 +189,6 @@ Leeloo can run on any Heroku-style platform. Configuration is performed via the
| `AWS_DEFAULT_REGION` | No | [Default region used by boto3.](http://boto3.readthedocs.io/en/latest/guide/configuration.html#environment-variable-configuration) |
| `AWS_SECRET_ACCESS_KEY` | No | Used as part of [boto3 auto-configuration](http://boto3.readthedocs.io/en/latest/guide/configuration.html#configuring-credentials). |
| `BULK_CREATE_BATCH_SIZE` | No | Used when loading Companies House records (default=5000). |
| `CDMS_AUTH_URL` | Yes | |
| `DATABASE_URL` | Yes | PostgreSQL server URL (with embedded credentials). |
| `DATAHUB_FRONTEND_BASE_URL` | Yes | |
| `DATAHUB_SECRET` | Yes | |
Expand Down Expand Up @@ -221,18 +219,6 @@ Leeloo can run on any Heroku-style platform. Configuration is performed via the
If using Docker, remember to run these commands inside your container by prefixing them with `docker-compose run leeloo`.
### CDMS authentication
Enable CDMS login for users (use this to let a CDMS user log in):
```shell
./manage.py manageusers [email protected] [email protected] --enable
```
Disable CDMS login for users:
```shell
./manage.py manageusers [email protected] [email protected] --disable
```
### Database
Apply migrations:
Expand Down
2 changes: 0 additions & 2 deletions config/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@
'index.mapping.nested_fields.limit': 100
}
DATAHUB_SECRET = env('DATAHUB_SECRET')
CDMS_AUTH_URL = env('CDMS_AUTH_URL')
CDMS_AUTH_TIMEOUT = env.int('CDMS_AUTH_TIMEOUT', 10)
CDMS_TEXT_MAX_LENGTH = 4000
CHAR_FIELD_MAX_LENGTH = 255
HEROKU = False
Expand Down
1 change: 0 additions & 1 deletion config/settings/sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ DATABASE_URL=postgres://localhost/datahub
ES5_URL=http://localhost:9200
ES_INDEX=test
DATAHUB_SECRET=secret
CDMS_AUTH_URL=http://example.com
DOCKER_DEV=True
AWS_DEFAULT_REGION=eu-west-2
AWS_ACCESS_KEY_ID=foo
Expand Down
18 changes: 2 additions & 16 deletions datahub/company/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ class AdviserAdmin(BaseModelVersionAdmin, UserAdmin):
}),
('Permissions', {
'fields': (
'use_cdms_auth',
'is_active',
'is_staff',
'is_superuser',
Expand All @@ -103,20 +102,7 @@ class AdviserAdmin(BaseModelVersionAdmin, UserAdmin):
'fields': ('email', 'password1', 'password2'),
}),
)
list_display = ('email', 'first_name', 'last_name', 'is_staff', 'use_cdms_auth')
list_display = ('email', 'first_name', 'last_name', 'is_staff',)
search_fields = ('first_name', 'last_name', 'email')
ordering = ('email', 'use_cdms_auth')
list_filter = ('use_cdms_auth',)
ordering = ('email',)
actions = ['enable_users', 'disable_users']

def enable_users(self, request, queryset):
"""Enable users for login."""
queryset.update(use_cdms_auth=True)

enable_users.short_description = 'Enable users'

def disable_users(self, request, queryset):
"""Disable users for login."""
queryset.update(use_cdms_auth=False)

disable_users.short_description = 'Disable users.'
42 changes: 0 additions & 42 deletions datahub/company/management/commands/manageusers.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Migration(migrations.Migration):
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Deselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('use_cdms_auth', models.BooleanField(default=False, help_text='Whether CDMS authentication has been enabled for this user')),
('use_cdms_auth', models.BooleanField(default=False, help_text='No longer used')),
('dit_team', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='metadata.Team')),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
Expand Down
3 changes: 2 additions & 1 deletion datahub/company/models/adviser.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ class Advisor(AbstractBaseUser, PermissionsMixin):
),
)
date_joined = models.DateTimeField('date joined', default=now)
# TODO: Remove post-schema freeze
use_cdms_auth = models.BooleanField(
default=False,
help_text='Whether CDMS authentication has been enabled for this user'
help_text='No longer used'
)

objects = AdviserManager()
Expand Down
54 changes: 0 additions & 54 deletions datahub/company/test/test_admin.py

This file was deleted.

55 changes: 0 additions & 55 deletions datahub/company/test/test_management_commands.py

This file was deleted.

Loading

0 comments on commit e14350f

Please sign in to comment.