Skip to content

Commit

Permalink
Merge pull request #1492 from nextcloud/fix/donation-import
Browse files Browse the repository at this point in the history
fix: correctly import donation tag attributes
  • Loading branch information
edward-ly authored Sep 19, 2024
2 parents 39969cc + 5b130e0 commit cb10c0a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions nextcloudappstore/api/v1/release/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,17 @@ def create_screenshot(img: dict[str, str]) -> Screenshot:

class DonationsImporter(ScalarImporter):
def import_data(self, key: str, value: Any, obj: Any) -> None:
def create_donation(img: dict[str, str]) -> Donation:
def create_donation(dnt: dict[str, str]) -> Donation:
return Donation.objects.create(
url=img["url"],
url=dnt["url"],
app=obj,
ordering=img["ordering"],
title=img["title"],
type=img["type"],
ordering=dnt["ordering"],
title=dnt["title"],
type=dnt["type"],
)

shots = map(lambda val: create_donation(val["donation"]), value)
obj.donations.set(list(shots))
donations = map(lambda val: create_donation(val["donation"]), value)
obj.donations.set(list(donations))


class CategoryImporter(ScalarImporter):
Expand Down
8 changes: 4 additions & 4 deletions nextcloudappstore/api/v1/release/info.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@
<xsl:value-of select="."/>
</url>
<xsl:choose>
<xsl:when test="donation/@title">
<xsl:when test="@title">
<title>
<xsl:value-of select="donation/@title"/>
<xsl:value-of select="@title"/>
</title>
</xsl:when>
<xsl:otherwise>
<title>Donate to support this app</title>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="donation/@type">
<xsl:when test="@type">
<type>
<xsl:value-of select="donation/@type"/>
<xsl:value-of select="@type"/>
</type>
</xsl:when>
<xsl:otherwise>
Expand Down

0 comments on commit cb10c0a

Please sign in to comment.