diff options
author | tilly-Q <nattilypigeonfowl@gmail.com> | 2013-08-29 17:31:19 -0400 |
---|---|---|
committer | tilly-Q <nattilypigeonfowl@gmail.com> | 2013-08-29 17:31:19 -0400 |
commit | 1bb367f6136ae4cbcdf6dd86af65eb613913dbd8 (patch) | |
tree | c3565801fcf21de1383b5bdb764208b3a98c8e49 /mediagoblin/db | |
parent | dfd66b789cd6cc9470c2a98bcbda9ee5e0f3ad0f (diff) | |
download | mediagoblin-1bb367f6136ae4cbcdf6dd86af65eb613913dbd8.tar.lz mediagoblin-1bb367f6136ae4cbcdf6dd86af65eb613913dbd8.tar.xz mediagoblin-1bb367f6136ae4cbcdf6dd86af65eb613913dbd8.zip |
This is a quick commit. I gave admins the ability to ban or unban users
straight from the moderation.users_detail page. I also changed the
UserBan.expiration_date type from DateTime into Date. I also began work on the
Terms of Service, pulled from another website (which will be cited clearly
before I'm done). I added new tests as well for the ban/unbanning. Lastly,
I added a few `user_not_banned` decorators to relevant views, so banned users
cannot access any pages.
Diffstat (limited to 'mediagoblin/db')
-rw-r--r-- | mediagoblin/db/migrations.py | 4 | ||||
-rw-r--r-- | mediagoblin/db/models.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/mediagoblin/db/migrations.py b/mediagoblin/db/migrations.py index a97458b6..6659feb3 100644 --- a/mediagoblin/db/migrations.py +++ b/mediagoblin/db/migrations.py @@ -19,7 +19,7 @@ import uuid from sqlalchemy import (MetaData, Table, Column, Boolean, SmallInteger, Integer, Unicode, UnicodeText, DateTime, - ForeignKey) + ForeignKey, Date) from sqlalchemy.exc import ProgrammingError from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.sql import and_ @@ -501,7 +501,7 @@ class UserBan_v0(declarative_base()): __tablename__ = 'core__user_bans' user_id = Column('id',Integer, ForeignKey(User.id), nullable=False, primary_key=True) - expiration_date = Column(DateTime) + expiration_date = Column(Date) reason = Column(UnicodeText, nullable=False) class Privilege_v0(declarative_base()): diff --git a/mediagoblin/db/models.py b/mediagoblin/db/models.py index dd2cd3e9..1e8d0a0c 100644 --- a/mediagoblin/db/models.py +++ b/mediagoblin/db/models.py @@ -23,7 +23,7 @@ import datetime from sqlalchemy import Column, Integer, Unicode, UnicodeText, DateTime, \ Boolean, ForeignKey, UniqueConstraint, PrimaryKeyConstraint, \ - SmallInteger + SmallInteger, Date from sqlalchemy.orm import relationship, backref, with_polymorphic from sqlalchemy.orm.collections import attribute_mapped_collection from sqlalchemy.sql.expression import desc @@ -777,7 +777,7 @@ class UserBan(Base): user_id = Column(Integer, ForeignKey(User.id), nullable=False, primary_key=True) - expiration_date = Column(DateTime) + expiration_date = Column(Date) reason = Column(UnicodeText, nullable=False) |