Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It seems like self.tabs is getting set to an empty set [] now rather tha... #481

Merged
merged 2 commits into from
Jul 23, 2013

Conversation

chrisndodge
Copy link
Contributor

...n None. This causes the tab defaulting to not populate, leading to crashes in the LMS if someone makes a new course with additional tabs (e.g. static tabs or pdf-textbooks)

…than None. This causes the tab defaulting to not populate, leading to crashes in the LMS if someone makes a new course with additional tabs (e.g. static tabs or pdf-textbooks)
@chrisndodge
Copy link
Contributor Author

@dmitchell can you review? Let's talk to Miki and Jay about cherry picking. I presume we want to wait until tests pass in any case.

@@ -410,7 +410,7 @@ def __init__(self, *args, **kwargs):
continue

# TODO check that this is still needed here and can't be by defaults.
if self.tabs is None:
if not self.tabs or (isinstance(self.tabs, list) and len(self.tabs) == 0):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not self.tabs:
is sufficient. That's what I put into the release.

…s as expected. Also update factory to not override defaults on tabs array. Also simplfy self.tab test condition.
@chrisndodge
Copy link
Contributor Author

@dmitchell added unit test in CMS - there were already some tab tests there, so I just added a new one. Was able to repro bug in unit test and then "fix" it, confirming it via the unit test.

@@ -38,16 +38,6 @@ def _create(cls, target_class, **kwargs):
new_course.display_name = display_name

new_course.lms.start = datetime.datetime.now(UTC).replace(microsecond=0)
new_course.tabs = kwargs.pop(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@dmitchell
Copy link
Contributor

👍

chrisndodge pushed a commit that referenced this pull request Jul 23, 2013
…lization

It seems like self.tabs is getting set to an empty set [] now rather tha...
@chrisndodge chrisndodge merged commit 077f0a2 into master Jul 23, 2013
@chrisndodge chrisndodge deleted the fix/cdodge/regression-on-tabs-initialization branch August 8, 2013 18:41
diegomillan pushed a commit to eduNEXT/edx-platform that referenced this pull request Sep 14, 2016
* kc/logistration_enable_footer_and_custom_form:
  Customize logistration registration page
  Show footer for logistration pages
xavierchan pushed a commit to xavierchan/edx-platform-1 that referenced this pull request Aug 19, 2019
Sujeet1379 pushed a commit to chandrudev/edx-platform that referenced this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants