Rename 'active' to 'writable'

This commit is contained in:
XANTRONIX Development 2024-12-02 17:22:56 -05:00
parent ea16a989f6
commit ee1c98c82d
3 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@ create table newsgroup (
created_by TEXT NOT NULL, created_by TEXT NOT NULL,
name TEXT NOT NULL, name TEXT NOT NULL,
description TEXT NOT NULL, description TEXT NOT NULL,
active BOOLEAN NOT NULL DEFAULT FALSE writable BOOLEAN NOT NULL DEFAULT FALSE
); );
create table message ( create table message (

View file

@ -7,7 +7,7 @@ class Newsgroup(DatabaseTable):
key = 'id' key = 'id'
columns = ( columns = (
'id', 'created_on', 'created_by', 'name', 'description', 'id', 'created_on', 'created_by', 'name', 'description',
'active' 'writable'
) )
@staticmethod @staticmethod
@ -18,7 +18,7 @@ class Newsgroup(DatabaseTable):
newsgroup.created_by = row['created_by'] newsgroup.created_by = row['created_by']
newsgroup.name = row['name'] newsgroup.name = row['name']
newsgroup.description = row['description'] newsgroup.description = row['description']
newsgroup.active = row['active'] newsgroup.writable = row['writable']
return newsgroup return newsgroup
@ -28,5 +28,5 @@ class Newsgroup(DatabaseTable):
self.created_by, self.created_by,
self.name, self.name,
self.description, self.description,
self.active self.writable
) )

View file

@ -233,7 +233,7 @@ class Session():
'min': row[1], 'min': row[1],
'max': row[2], 'max': row[2],
'name': newsgroup.name, 'name': newsgroup.name,
'perms': 'y' if newsgroup.active else 'n' 'perms': 'y' if newsgroup.writable else 'n'
} }
def _cmd_listgroup(self, *args): def _cmd_listgroup(self, *args):
@ -709,7 +709,7 @@ class Session():
for name in names: for name in names:
newsgroup = self.server.newsgroups.get(name) newsgroup = self.server.newsgroups.get(name)
if newsgroup is None or not newsgroup.active: if newsgroup is None or not newsgroup.writable:
return ResponseCode.NNTP_POST_PROHIBITED return ResponseCode.NNTP_POST_PROHIBITED
newsgroups.append(self.server.newsgroups[name]) newsgroups.append(self.server.newsgroups[name])