@@ -16,6 +16,7 @@ import (
16
16
17
17
"code.gitea.io/gitea/models"
18
18
"code.gitea.io/gitea/models/unit"
19
+ unit_model "code.gitea.io/gitea/models/unit"
19
20
"code.gitea.io/gitea/modules/base"
20
21
"code.gitea.io/gitea/modules/context"
21
22
"code.gitea.io/gitea/modules/git"
@@ -382,22 +383,22 @@ func renderEditPage(ctx *context.Context) {
382
383
func WikiPost (ctx * context.Context ) {
383
384
switch ctx .FormString ("action" ) {
384
385
case "_new" :
385
- if ! ctx .Repo .CanWrite (models . UnitTypeWiki ) {
386
+ if ! ctx .Repo .CanWrite (unit_model . TypeWiki ) {
386
387
ctx .NotFound (ctx .Req .URL .RequestURI (), nil )
387
388
return
388
389
}
389
390
NewWikiPost (ctx )
390
391
return
391
392
case "_delete" :
392
- if ! ctx .Repo .CanWrite (models . UnitTypeWiki ) {
393
+ if ! ctx .Repo .CanWrite (unit_model . TypeWiki ) {
393
394
ctx .NotFound (ctx .Req .URL .RequestURI (), nil )
394
395
return
395
396
}
396
397
DeleteWikiPagePost (ctx )
397
398
return
398
399
}
399
400
400
- if ! ctx .Repo .CanWrite (models . UnitTypeWiki ) {
401
+ if ! ctx .Repo .CanWrite (unit_model . TypeWiki ) {
401
402
ctx .NotFound (ctx .Req .URL .RequestURI (), nil )
402
403
return
403
404
}
@@ -423,14 +424,14 @@ func Wiki(ctx *context.Context) {
423
424
WikiRevision (ctx )
424
425
return
425
426
case "_edit" :
426
- if ! ctx .Repo .CanWrite (models . UnitTypeWiki ) {
427
+ if ! ctx .Repo .CanWrite (unit_model . TypeWiki ) {
427
428
ctx .NotFound (ctx .Req .URL .RequestURI (), nil )
428
429
return
429
430
}
430
431
EditWiki (ctx )
431
432
return
432
433
case "_new" :
433
- if ! ctx .Repo .CanWrite (models . UnitTypeWiki ) {
434
+ if ! ctx .Repo .CanWrite (unit_model . TypeWiki ) {
434
435
ctx .NotFound (ctx .Req .URL .RequestURI (), nil )
435
436
return
436
437
}
0 commit comments