try a new function with clearing the key
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m45s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m45s
This commit is contained in:
@@ -41,6 +41,7 @@ urlpatterns = [
|
|||||||
path('redirect/get/<str:key>', website_redirectionapp.display_key),
|
path('redirect/get/<str:key>', website_redirectionapp.display_key),
|
||||||
path('redirect/go/<str:key>', website_redirectionapp.redirect_to_key),
|
path('redirect/go/<str:key>', website_redirectionapp.redirect_to_key),
|
||||||
path('redirect/redirect-form/', website_redirectionapp.redirect_process, name='submit_form'),
|
path('redirect/redirect-form/', website_redirectionapp.redirect_process, name='submit_form'),
|
||||||
|
path('redirect/clearkey/', website_redirectionapp.clearkey_process, name='submit_form'),
|
||||||
|
|
||||||
|
|
||||||
################### paperless ###################
|
################### paperless ###################
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ def hello(request):
|
|||||||
def redirect(request):
|
def redirect(request):
|
||||||
return render(request, 'redirect_form.html',{})
|
return render(request, 'redirect_form.html',{})
|
||||||
|
|
||||||
|
def clearkey_process(request):
|
||||||
|
key = request.GET.get('key')
|
||||||
|
r.delete(key)
|
||||||
|
return 0
|
||||||
|
|
||||||
def redirect_process(request):
|
def redirect_process(request):
|
||||||
key = request.GET.get('key')
|
key = request.GET.get('key')
|
||||||
|
|||||||
@@ -270,13 +270,16 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<label for="value" id="value-label">
|
<label for="value" id="value-label">
|
||||||
Value *
|
Value *
|
||||||
<input class="" type="value" id="value" name="value" placeholder="Enter the value (required)" required />
|
<input class="" type="value" id="value" name="value" placeholder="Enter the value (required)" />
|
||||||
</label>
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<button id="submit" type="submit" class="btn">Submit the form</button>
|
<button id="submit" type="submit" class="btn">Submit the form</button>
|
||||||
</form>
|
<button id="clearkey" type="submit" formaction="/redirect/clearkey/"> class="btn">Clear the key</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user