fix: form submit must have name subscribe_to_search to trigger
This commit is contained in:
parent
8299162a77
commit
a617137fb0
@ -12,7 +12,7 @@
|
|||||||
<button class="btn" type="submit" value="search" name="search">
|
<button class="btn" type="submit" value="search" name="search">
|
||||||
<i class="fas fa-search"></i> {% trans 'Suchen' %}
|
<i class="fas fa-search"></i> {% trans 'Suchen' %}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn" type="submit" value="search" name="search">
|
<button class="btn" type="submit" name="subscribe_to_search">
|
||||||
<i class="fas fa-bell"></i> {% trans 'Suche abonnieren' %}
|
<i class="fas fa-bell"></i> {% trans 'Suche abonnieren' %}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
@ -178,8 +178,8 @@ def search(request):
|
|||||||
# Make sure user is logged in
|
# Make sure user is logged in
|
||||||
if not request.user.is_authenticated:
|
if not request.user.is_authenticated:
|
||||||
return redirect(f"{settings.LOGIN_URL}?next={request.path}")
|
return redirect(f"{settings.LOGIN_URL}?next={request.path}")
|
||||||
|
|
||||||
search.subscribe(request.user)
|
search.subscribe(request.user)
|
||||||
|
|
||||||
context = {"adoption_notices": search.get_adoption_notices(), "search_form": search.search_form,
|
context = {"adoption_notices": search.get_adoption_notices(), "search_form": search.search_form,
|
||||||
"place_not_found": search.place_not_found}
|
"place_not_found": search.place_not_found}
|
||||||
return render(request, 'fellchensammlung/search.html', context=context)
|
return render(request, 'fellchensammlung/search.html', context=context)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user