Commit 45aa830a by Kevin Falcone

Merge pull request #58 from edx/jibsheet/dont-use-using

Jibsheet/dont use using
parents bebda677 da3df6d5
...@@ -16,16 +16,14 @@ DEFAULT_PROFILES = [ ...@@ -16,16 +16,14 @@ DEFAULT_PROFILES = [
def create_default_profiles(apps, schema_editor): def create_default_profiles(apps, schema_editor):
""" Add default profiles """ """ Add default profiles """
Profile = apps.get_model("edxval", "Profile") Profile = apps.get_model("edxval", "Profile")
db_alias = schema_editor.connection.alias
for profile in DEFAULT_PROFILES: for profile in DEFAULT_PROFILES:
Profile.objects.using(db_alias).get_or_create(profile_name=profile) Profile.objects.get_or_create(profile_name=profile)
def delete_default_profiles(apps, schema_editor): def delete_default_profiles(apps, schema_editor):
""" Remove default profiles """ """ Remove default profiles """
Profile = apps.get_model("edxval", "Profile") Profile = apps.get_model("edxval", "Profile")
db_alias = schema_editor.connection.alias Profile.objects.filter(profile_name__in=DEFAULT_PROFILES).delete()
Profile.objects.using(db_alias).filter(profile_name__in=DEFAULT_PROFILES).delete()
class Migration(migrations.Migration): class Migration(migrations.Migration):
......
...@@ -39,7 +39,7 @@ def load_requirements(*requirements_paths): ...@@ -39,7 +39,7 @@ def load_requirements(*requirements_paths):
setup( setup(
name='edxval', name='edxval',
version='0.0.8', version='0.0.9',
author='edX', author='edX',
url='http://github.com/edx/edx-val', url='http://github.com/edx/edx-val',
description='edx-val', description='edx-val',
......
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