Skip to content

Commit

Permalink
Remove legacy code for item-badge relationship
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelm committed May 9, 2024
1 parent ff47111 commit c0616df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,10 @@ fun getBadgeLayout(application: PretixScan, position: JSONObject, eventSlug: Str
}
}

/* Legacy mechanism: Keep around until pretix 2.5 is end of life */
val item = application.data.select(Item::class.java)
.where(Item.SERVER_ID.eq(itemid_server))
.get().firstOrNull() ?: return getDefaultBadgeLayout()
if (item.getBadge_layout_id() != null) {
return application.data.select(BadgeLayout::class.java)
.where(BadgeLayout.SERVER_ID.eq(item.getBadge_layout_id()))
.and(BadgeLayout.EVENT_SLUG.eq(eventSlug))
.get().firstOrNull() ?: getDefaultBadgeLayout()
} else { // Also used for current pretix versions for obtaining the event's default badge layout
return application.data.select(BadgeLayout::class.java)
.where(BadgeLayout.IS_DEFAULT.eq(true))
.and(BadgeLayout.EVENT_SLUG.eq(eventSlug))
.get().firstOrNull() ?: getDefaultBadgeLayout()
}
return application.data.select(BadgeLayout::class.java)
.where(BadgeLayout.IS_DEFAULT.eq(true))
.and(BadgeLayout.EVENT_SLUG.eq(eventSlug))
.get().firstOrNull() ?: getDefaultBadgeLayout()
}

fun isPackageInstalled(packagename: String, packageManager: PackageManager): Boolean {
Expand Down

0 comments on commit c0616df

Please sign in to comment.