Fixed a bug where opening private pastas would crash MicroBin
This commit is contained in:
parent
4cc737731a
commit
35d4df2cb8
2 changed files with 2 additions and 4 deletions
|
@ -23,8 +23,6 @@ pub async fn list(data: web::Data<AppState>) -> HttpResponse {
|
||||||
|
|
||||||
let mut pastas = data.pastas.lock().unwrap();
|
let mut pastas = data.pastas.lock().unwrap();
|
||||||
|
|
||||||
pastas.retain(|p| !p.private);
|
|
||||||
|
|
||||||
remove_expired(&mut pastas);
|
remove_expired(&mut pastas);
|
||||||
|
|
||||||
HttpResponse::Found().content_type("text/html").body(
|
HttpResponse::Found().content_type("text/html").body(
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for pasta in pastas %}
|
{% for pasta in pastas %}
|
||||||
{% if pasta.pasta_type == "text" %}
|
{% if pasta.pasta_type == "text" && !pasta.private %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="/pasta/{{pasta.id_as_animals()}}">{{pasta.id_as_animals()}}</a>
|
<a href="/pasta/{{pasta.id_as_animals()}}">{{pasta.id_as_animals()}}</a>
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{% for pasta in pastas %}
|
{% for pasta in pastas %}
|
||||||
{% if pasta.pasta_type == "url" %}
|
{% if pasta.pasta_type == "url" && !pasta.private %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="/url/{{pasta.id_as_animals()}}">{{pasta.id_as_animals()}}</a>
|
<a href="/url/{{pasta.id_as_animals()}}">{{pasta.id_as_animals()}}</a>
|
||||||
|
|
Loading…
Reference in a new issue