Allow for anonymous access tokens for public repositories.
This commit is contained in:
parent
0652636693
commit
891f992bf2
3 changed files with 13 additions and 13 deletions
|
@ -68,7 +68,7 @@ def random_string_generator(length=16):
|
|||
|
||||
class AccessToken(BaseModel):
|
||||
code = CharField(default=random_string_generator(), unique=True, index=True)
|
||||
user = ForeignKeyField(User)
|
||||
user = ForeignKeyField(User, null=True)
|
||||
repository = ForeignKeyField(Repository)
|
||||
created = DateTimeField(default=datetime.now)
|
||||
|
||||
|
@ -124,7 +124,3 @@ def initialize_db():
|
|||
Role.create(name='read')
|
||||
Visibility.create(name='public')
|
||||
Visibility.create(name='private')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
initialize_db()
|
||||
|
|
Reference in a new issue