mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-09 01:18:04 +02:00
Bug fixes (#184)
* Fix gist content when going back to editing * Fix not outputting non-truncated large files for editon/zip download * Allow dashes in usernames * Delete keys associated to deleted user * Fix error message when there is no files in gist * Show if there is not files in gist preview * Fix log parsing for the 11th empty commit
This commit is contained in:
@ -53,6 +53,11 @@ func (user *User) BeforeDelete(tx *gorm.DB) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = tx.Where("user_id = ?", user.ID).Delete(&SSHKey{}).Error
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Delete all gists created by this user
|
||||
return tx.Where("user_id = ?", user.ID).Delete(&Gist{}).Error
|
||||
}
|
||||
@ -189,7 +194,7 @@ func (user *User) DeleteProviderID(provider string) error {
|
||||
// -- DTO -- //
|
||||
|
||||
type UserDTO struct {
|
||||
Username string `form:"username" validate:"required,max=24,alphanum,notreserved"`
|
||||
Username string `form:"username" validate:"required,max=24,alphanumdash,notreserved"`
|
||||
Password string `form:"password" validate:"required"`
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user