Set poll sources disabled by default with better interval options
- Poll sources now created with enabled=False by default - Admin must manually enable sources after adding them - Replace numeric interval input with dropdown: 15min to 24hr options - Default interval is 1 hour - Fix avatar upload form with proper multipart/form-data encoding 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
4
app.py
4
app.py
@@ -1360,13 +1360,13 @@ def admin_polling_add():
|
||||
flash(f'Source {platform}:{source_id} already exists', 'warning')
|
||||
return redirect(url_for('admin_polling'))
|
||||
|
||||
# Create new source
|
||||
# Create new source (disabled by default)
|
||||
source = PollSource(
|
||||
platform=platform,
|
||||
source_id=source_id,
|
||||
display_name=display_name,
|
||||
poll_interval_minutes=poll_interval,
|
||||
enabled=True,
|
||||
enabled=False,
|
||||
created_by=current_user.id
|
||||
)
|
||||
|
||||
|
||||
@@ -232,7 +232,16 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="poll_interval">Poll Interval (minutes)</label>
|
||||
<input type="number" class="form-input" name="poll_interval" id="poll_interval" value="60" min="5" required>
|
||||
<select class="form-select" name="poll_interval" id="poll_interval" required>
|
||||
<option value="15">15 minutes</option>
|
||||
<option value="30">30 minutes</option>
|
||||
<option value="60" selected>1 hour</option>
|
||||
<option value="120">2 hours</option>
|
||||
<option value="240">4 hours</option>
|
||||
<option value="360">6 hours</option>
|
||||
<option value="720">12 hours</option>
|
||||
<option value="1440">24 hours</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Add Source</button>
|
||||
|
||||
Reference in New Issue
Block a user