Add a waffle.flag in order to force overlay usage
This commit is contained in:
parent
763f69cb61
commit
23c056e046
1 changed files with 7 additions and 2 deletions
9
vendor/registrasion/registrasion/views.py
vendored
9
vendor/registrasion/registrasion/views.py
vendored
|
@ -1116,8 +1116,11 @@ def _get_badge_template_name():
|
||||||
@login_required
|
@login_required
|
||||||
def user_badge(request, format="png"):
|
def user_badge(request, format="png"):
|
||||||
'''Shows the logged-in user their badge'''
|
'''Shows the logged-in user their badge'''
|
||||||
|
if waffle.flag_is_active("force_badge_overlay"):
|
||||||
return render_badge(request.user, format)
|
overlay=True
|
||||||
|
else:
|
||||||
|
overlay=False
|
||||||
|
return render_badge(request.user, format, overlay)
|
||||||
|
|
||||||
@user_passes_test(_staff_only)
|
@user_passes_test(_staff_only)
|
||||||
def badge(request, user_id, format="png"):
|
def badge(request, user_id, format="png"):
|
||||||
|
@ -1147,6 +1150,8 @@ def _convert_img(img, outformat="png",dpi=200,width=None):
|
||||||
return out
|
return out
|
||||||
|
|
||||||
def render_badge(user, format="png", overlay=False):
|
def render_badge(user, format="png", overlay=False):
|
||||||
|
if waffle.flag_is_active("force_badge_overlay"):
|
||||||
|
overlay=True
|
||||||
rendered = render_badge_svg(user, overlay=overlay)
|
rendered = render_badge_svg(user, overlay=overlay)
|
||||||
if format == "png":
|
if format == "png":
|
||||||
rendered = _convert_img(rendered, outformat="png")
|
rendered = _convert_img(rendered, outformat="png")
|
||||||
|
|
Loading…
Reference in a new issue