mj add another admin
This commit is contained in:
@@ -16,18 +16,14 @@ dashboard = Blueprint('dashboard', __name__)
|
||||
def index():
|
||||
conn = get_db()
|
||||
|
||||
# Get the logged-in user's clan
|
||||
clan = conn.execute(
|
||||
'SELECT id FROM clans WHERE owner_id = ?', (current_user.id,)
|
||||
).fetchone()
|
||||
# Get the clan the logged-in user belongs to
|
||||
clan_id = current_user.clan_id
|
||||
|
||||
if not clan:
|
||||
# User has no clan yet — send them to options to create one
|
||||
if not clan_id:
|
||||
# User has no clan yet — send them to options to create/join one
|
||||
conn.close()
|
||||
return render_template('index.html', players=[], no_clan=True)
|
||||
|
||||
clan_id = clan['id']
|
||||
|
||||
# Only fetch players that are members of this clan
|
||||
rows = conn.execute('''
|
||||
SELECT ts.player, ts.player_id, MAX(ts.updated_at) as last_seen, MAX(ts.world_id) as world_id
|
||||
|
||||
Reference in New Issue
Block a user