Skip to content

Commit

Permalink
Remove admin status check from renewal logic and update profile valid…
Browse files Browse the repository at this point in the history
…ation

- Remove admin status condition from renewal date check in common_data view
- Modify base.html JavaScript to remove admin-specific profile validation checks
- Adjust profile validation logic to apply to all users regardless of admin status
  • Loading branch information
NagiPragalathan committed Feb 10, 2025
1 parent 6f5c059 commit f8d961c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Binary file modified base/views/__pycache__/common.cpython-312.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion base/views/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def common_data(request):

print(current_date, renewal_date)

if (current_date > renewal_date) or is_admin:
if (current_date > renewal_date):
renewal_message = 1 # Indicates expired renewal
days_left_for_renewal = (renewal_date - current_date).days # Negative value for expired
else:
Expand Down
12 changes: 6 additions & 6 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -1832,23 +1832,23 @@ <h2 class="text-sm font-semibold text-gray-800">{{ usr_name }}</h2>
let check_usr_bio = {{ bio }}
let check_usr_contact = {{ contact }}
let is_admin = {{ is_admin }}

console.log("onload", check_usr_profile, check_usr_bio, check_usr_contact, is_admin)
document.addEventListener("DOMContentLoaded", function() {
// Check if the renewal date is set\
console.log("onload", check_usr)
console.log("is_admin", is_admin)
if (is_admin == 1) {
if (check_usr_profile == 1) {
if (check_usr_profile == 0) {
document.getElementById("error-pop").style.display = "flex";
}
if (check_usr_bio == 1) {
if (check_usr_bio == 0) {
document.getElementById("error-pop").style.display = "flex";
}
if (check_usr_contact == 1) {
if (check_usr_contact == 0) {
document.getElementById("error-pop").style.display = "flex";
}
}

if (check_usr == 1) {
if (check_usr == 0) {
document.getElementById("subscription_expired-pop").style.display = "flex";
} else {
console.log("valied user...!");
Expand Down

0 comments on commit f8d961c

Please sign in to comment.