Commit 6845790d by Will Daly

Merge pull request #7047 from edx/hotfix/fix-linkedin-migration

Hotfix: Make the linked in configuration migration backwards compatible
parents ed8c0a10 5c00db9f
...@@ -8,9 +8,6 @@ from django.db import models ...@@ -8,9 +8,6 @@ from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):
def forwards(self, orm): def forwards(self, orm):
# Deleting field 'LinkedInAddToProfileConfiguration.dashboard_tracking_code'
db.delete_column('student_linkedinaddtoprofileconfiguration', 'dashboard_tracking_code')
# Adding field 'LinkedInAddToProfileConfiguration.company_identifier' # Adding field 'LinkedInAddToProfileConfiguration.company_identifier'
db.add_column('student_linkedinaddtoprofileconfiguration', 'company_identifier', db.add_column('student_linkedinaddtoprofileconfiguration', 'company_identifier',
self.gf('django.db.models.fields.TextField')(default=''), self.gf('django.db.models.fields.TextField')(default=''),
...@@ -18,11 +15,6 @@ class Migration(SchemaMigration): ...@@ -18,11 +15,6 @@ class Migration(SchemaMigration):
def backwards(self, orm): def backwards(self, orm):
# Adding field 'LinkedInAddToProfileConfiguration.dashboard_tracking_code'
db.add_column('student_linkedinaddtoprofileconfiguration', 'dashboard_tracking_code',
self.gf('django.db.models.fields.TextField')(default='', blank=True),
keep_default=False)
# Deleting field 'LinkedInAddToProfileConfiguration.company_identifier' # Deleting field 'LinkedInAddToProfileConfiguration.company_identifier'
db.delete_column('student_linkedinaddtoprofileconfiguration', 'company_identifier') db.delete_column('student_linkedinaddtoprofileconfiguration', 'company_identifier')
...@@ -109,6 +101,7 @@ class Migration(SchemaMigration): ...@@ -109,6 +101,7 @@ class Migration(SchemaMigration):
'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), 'change_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}), 'changed_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'on_delete': 'models.PROTECT'}),
'company_identifier': ('django.db.models.fields.TextField', [], {}), 'company_identifier': ('django.db.models.fields.TextField', [], {}),
'dashboard_tracking_code': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'enabled': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
}, },
......
...@@ -1464,6 +1464,9 @@ class LinkedInAddToProfileConfiguration(ConfigurationModel): ...@@ -1464,6 +1464,9 @@ class LinkedInAddToProfileConfiguration(ConfigurationModel):
) )
) )
# Deprecated
dashboard_tracking_code = models.TextField(default="", blank=True)
def add_to_profile_url(self, course_name, enrollment_mode, cert_url, source="o"): def add_to_profile_url(self, course_name, enrollment_mode, cert_url, source="o"):
"""Construct the URL for the "add to profile" button. """Construct the URL for the "add to profile" button.
......
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