Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
roniahmadi committed Jun 17, 2024
1 parent 064addc commit a3894ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/templates/member/register_code_input.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<input type="text" name="applied" value="" required class="w-full my-4 rounded-lg"/>
<button type="submit" class="bg-green-600 text-center p-3 rounded w-full text-white">Submit Code</button>
</form>
<a class="bg-red-600 text-center p-2 rounded text-white w-full" href="{% url 'register_member' %}">Batal</a>
<a class="bg-red-600 text-center p-2 rounded text-white w-full" href="{% url 'profile' %}">Batal</a>

</div>
</div>
Expand Down
13 changes: 8 additions & 5 deletions frontend/views/profile/register_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ def get(self, request):
if applied.exists():
applied = applied.first()
accept = True
code = UserCodeGenerator.objects.filter(user_id=request.user.id, is_active=True)
if code.exists():
codes = code.first()
if codes.is_active:
return redirect(reverse('profile'))
applied_true = UserAppliedMember.objects.filter(user_id=request.user.id, is_accept=True)
if applied_true.exists():
applied_true = applied_true.first()
code = UserCodeGenerator.objects.filter(user_apply_id=applied_true.id)
if code.exists():
codes = code.first()
if codes.is_active:
return redirect(reverse('register_member_code'))
return render(
request,
"member/register.html",
Expand Down

0 comments on commit a3894ad

Please sign in to comment.