summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-24 19:31:24 +0200
committerSanto Cariotti <santo@dcariotti.me>2022-09-24 19:33:37 +0200
commit33962f0b9650b32d1ee313a06cefc9f81b910e4c (patch)
tree8a65c238673ce29dd44d8fd4297329bca7d12ca0
parent3dd06813066bf44b4c651662824ff51e1bb0305e (diff)
Prevent glitch on not authorized pages
-rw-r--r--pages/models/_id/edit.vue5
1 files changed, 3 insertions, 2 deletions
diff --git a/pages/models/_id/edit.vue b/pages/models/_id/edit.vue
index 7b8155e..8ced3e2 100644
--- a/pages/models/_id/edit.vue
+++ b/pages/models/_id/edit.vue
@@ -42,9 +42,10 @@ export default {
if (response.status != 200) {
window.location.href = "/models";
} else {
- this.model = response.data;
- if (!(this.model.author_id == this.me.id || this.me.is_staff)) {
+ if (!(response.data.author_id == this.me.id || this.me.is_staff)) {
window.location.href = "/models/" + this.id;
+ } else {
+ this.model = response.data;
}
}
});