Răsfoiți Sursa

Rename the type_ column in pagure_logs to log_type

Pierre-Yves Chibon 7 ani în urmă
părinte
comite
810c3d25db
3 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 1 1
      pagure/api/user.py
  2. 1 1
      pagure/lib/__init__.py
  3. 2 2
      pagure/lib/model.py

+ 1 - 1
pagure/api/user.py

@@ -301,7 +301,7 @@ def api_view_user_activity_date(username, date):
         commits = collections.defaultdict(list)
         acts = []
         for activity in activities:
-            if activity.type_ == 'commit':
+            if activity.log_type == 'commit':
                 commits[activity.project.fullname].append(activity)
             else:
                 acts.append(activity)

+ 1 - 1
pagure/lib/__init__.py

@@ -3343,7 +3343,7 @@ def log_action(session, action, obj):
     log = model.PagureLog(
         user_id=obj.user_id,
         project_id=project_id,
-        type_=obj.isa,
+        log_type=obj.isa,
         description=desc % arg,
         date=obj.date_created.date(),
         date_created=obj.date_created

+ 2 - 2
pagure/lib/model.py

@@ -1594,7 +1594,7 @@ class PagureLog(BASE):
         nullable=True,
         index=True
     )
-    type_ = sa.Column(sa.Text, nullable=False)
+    log_type = sa.Column(sa.Text, nullable=False)
     description = sa.Column(sa.Text, nullable=False)
     date = sa.Column(
         sa.Date,
@@ -1630,7 +1630,7 @@ class PagureLog(BASE):
         '''
         output = {
             'id': self.id,
-            'type': self.type_,
+            'type': self.log_type,
             'description': self.description,
             'date': self.date.strftime('%Y-%m-%d'),
             'date_created': self.date_created.strftime('%s'),