Skip to content

[STUD-406] Fix/cdodge/unescape quote strings - #387

Merged
chrisndodge merged 6 commits into
masterfrom
fix/cdodge/unescape-quote-strings
Jul 12, 2013
Merged

[STUD-406] Fix/cdodge/unescape quote strings#387
chrisndodge merged 6 commits into
masterfrom
fix/cdodge/unescape-quote-strings

Conversation

@chrisndodge

Copy link
Copy Markdown
Contributor

No description provided.

Chris Dodge added 3 commits July 12, 2013 11:13
@chrisndodge

Copy link
Copy Markdown
Contributor Author

@cpennington @cahrens can you review. Cale, I know we had discussed cleaning up more of the unnecessarily nested code in the XML exporting in xml_module.py, but all I have time to get done today is the immediate tactical fix and I'd like this to be in the next release candidate.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I'd rather have this logic just live in serialize_field, rather than having a lambda containing an if clause in the AttrMap

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe @cahrens can comment on this but I wasn't sure if we want this behavior globally or just on the 'export' feature. That's why I separated the helper functions.

If serialize_field is current - and remain so in the future - only called on export use cases, then I'm fine with moving the logic.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

serialize_field should really only be for serializing fields to xml, which is exactly when we want this behavior.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Christina, can you confirm this? If so, then I can refactor this - as well
as updating the existing test cases.

On Fri, Jul 12, 2013 at 12:22 PM, Calen Pennington <notifications@github.com

wrote:

In common/lib/xmodule/xmodule/xml_module.py:

 return json.dumps(value, cls=EdxJSONEncoder)

+def serialize_string_literal(
value):

  • """
  • Assert that the value is a base string and - if it is - simply return it
  • """
  • if not isinstance(value, basestring):
  •    raise Exception('Value {0} is not of type basestring!'.format(value))
    
  • return value

serialize_field should really only be for serializing fields to xml,
which is exactly when we want this behavior.


Reply to this email directly or view it on GitHubhttps://github.com/edx/pull/387/files#r5168720
.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes, I agree this should be within serialize_field. It will also make the unit tests represent how we actually serialize strings.

@cahrens

cahrens commented Jul 12, 2013

Copy link
Copy Markdown

@chrisndodge I agree about putting the String-specific serialization within the serialize_field method.

@chrisndodge

Copy link
Copy Markdown
Contributor Author

@cpennington @cahrens ok refactored into that single serialize_field() function

@cahrens

cahrens commented Jul 12, 2013

Copy link
Copy Markdown

👍 (once tests pass). BTW, I did not check out the branch and run it.

chrisndodge pushed a commit that referenced this pull request Jul 12, 2013
[STUD-406] Fix/cdodge/unescape quote strings
@chrisndodge
chrisndodge merged commit 8f74342 into master Jul 12, 2013
@chrisndodge
chrisndodge deleted the fix/cdodge/unescape-quote-strings branch August 8, 2013 18:39
e-kolpakov referenced this pull request in open-craft/openedx-platform Mar 3, 2015
…-followed-posts

Fixed cohort visibility label when viewing "Posts I'm following"
kawaguchi-ks added a commit to nttks/edx-platform that referenced this pull request Oct 6, 2015
Merge pull request openedx#376 from kawaguchi-ks/develop/cypress/fix-trans-309
diegomillan pushed a commit to eduNEXT/edx-platform that referenced this pull request Sep 14, 2016
* stv/test/tabs:
  Remove check for course tab uniqueness
xavierchan pushed a commit to xavierchan/edx-platform-1 that referenced this pull request May 20, 2019
MoisesGSalas pushed a commit to eduNEXT/edx-platform that referenced this pull request Jan 12, 2022
…-patch-django-mysql

FAL-2248: Monkey-patch django db introspection to avoid performance issues
jbcurtin pushed a commit to jbcurtin/edx-platform that referenced this pull request Jan 31, 2022
…-patch-django-mysql

FAL-2248: Monkey-patch django db introspection to avoid performance issues
(cherry picked from commit 213b1dc)
Danyal-Faheem pushed a commit to Danyal-Faheem/edx-platform that referenced this pull request Jul 15, 2025
Signed-off-by: GitHub <noreply@github.com>
Co-authored-by: Ali-Salman29 <Ali-Salman29@users.noreply.github.com>
kiram15 pushed a commit that referenced this pull request Jul 17, 2026
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.

3 participants