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/go/<str:key>', website_redirectionapp.redirect_to_key),
|
||||
path('redirect/redirect-form/', website_redirectionapp.redirect_process, name='submit_form'),
|
||||
path('redirect/clearkey/', website_redirectionapp.clearkey_process, name='submit_form'),
|
||||
|
||||
|
||||
################### paperless ###################
|
||||
|
||||
@@ -16,6 +16,10 @@ def hello(request):
|
||||
def redirect(request):
|
||||
return render(request, 'redirect_form.html',{})
|
||||
|
||||
def clearkey_process(request):
|
||||
key = request.GET.get('key')
|
||||
r.delete(key)
|
||||
return 0
|
||||
|
||||
def redirect_process(request):
|
||||
key = request.GET.get('key')
|
||||
|
||||
@@ -270,13 +270,16 @@
|
||||
<fieldset>
|
||||
<label for="value" id="value-label">
|
||||
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>
|
||||
</fieldset>
|
||||
|
||||
<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>
|
||||
</main>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user