Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryJi529 committed Jun 4, 2024
1 parent 57dc37e commit c4214bd
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions apps/share/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ def route(request: HttpRequest, id):


def get_qrcode(request: HttpRequest):
session_key = request.session.session_key
conn = get_redis_connection("default")
link = conn.get(f"{session_key}-share-qrcode")
link = request.session.get("share-qrcode")
back_color = (255, 255, 255)
center_color = (250, 200, 100)
edge_color = (75, 150, 60)
Expand All @@ -69,12 +67,5 @@ def submit(request: HttpRequest):
item.save()
id = item.id
link = f"redirect/{id}/"
request.session.cycle_key()
session_key = request.session.session_key
conn = get_redis_connection("default")
conn.set(
f"{session_key}-share-qrcode",
"https://morningstar369.com/share/" + link,
ex=60 * 10,
)
request.session["share-qrcode"] = "https://morningstar369.com/share/" + link
return Response({"link": link})

0 comments on commit c4214bd

Please sign in to comment.