File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class Status(models.Model):
3333 additional_info = models .TextField (blank = True , null = True )
3434
3535 def __str__ (self ):
36- return '[{id}] {owner}' .format (id = self .id , title = self .owner .username )
36+ return '[{id}] {owner}' .format (id = self .id , owner = self .owner .username )
3737
3838 class Meta :
3939 indexes = [
Original file line number Diff line number Diff line change @@ -101,17 +101,17 @@ def process(x):
101101 status_filter = {}
102102 data = request .GET
103103
104- if type (data .get ('problem' )) == int :
105- status_filter ['problem' ] = get_object_or_404 (Problem , pid = data ['problem' ]).id
104+ if data .get ('problem' ) is not None :
105+ if data ['problem' ].isdecimal ():
106+ status_filter ['problem' ] = get_object_or_404 (Problem , pid = int (data ['problem' ])).id
106107
107108 if data .get ('lang' ) is not None :
108- status_filter ['lang' ] = data ['lang' ]
109+ if data ['lang' ].isdecimal ():
110+ status_filter ['lang' ] = int (data ['lang' ])
109111
110112 if data .get ('owner' ) is not None :
111- status_filter ['owner' ] = data ['owner' ]
112-
113- if data .get ('score' ) is not None :
114- status_filter ['score' ] = data ['score' ]
113+ if data ['owner' ].isdecimal ():
114+ status_filter ['owner' ] = int (data ['owner' ])
115115
116116 queryset = Status .objects .filter (** status_filter ).order_by ('-add_time' )
117117
You can’t perform that action at this time.
0 commit comments